I am trying to create and view tables in AWS Athena from S3 using SQL queries.
Here is the sequence
CREATE DATABASE testaccesspoint
CREATE EXTERNAL TABLE IF NOT EXISTS `testaccesspoint`......
show tables
The above queries ran successfully and created the database, so I don't feel there is any need to put the complete queries here for this.
Now I am trying to view the table using the query
SELECT * FROM "testaccesspoint"."mybucket" limit 10;
Here is the error I am getting:
[ErrorCode: INTERNAL_ERROR_QUERY_ENGINE] Amazon Athena experienced an internal error while executing this query. Please contact AWS support for further assistance. You will not be charged for this query. We apologize for the inconvenience.
This query ran against the "testaccesspoint" database, unless qualified by the query. Please post the error message on our forum or contact customer support with Query Id: 024fca79-447d-421f-ac6d-7b283de12adf
Related
I'm migrate from Teradata to BigQuery and I have a view that was working perfectly in Teradata but in BigQuery I have an error:
Resource exceeded during query execution: Not enough resources for
query planning - too many subqueries or query is too complex.
When I just run the view query it returns 38 million rows in 60 seconds, but when I try to select from the view I get an error.
Please help me understand this error or direct me where to look for a solution, thanks!
Query structure:
Select from table
a lot of joins
union all
Select from table
a lot of joins and few unions
I have tables in Azure Databricks that I am using SQL to interact with via a notebook. I need to select all columns from a table with 200 columns, I need to select all of them but I need to modify some for a select insert (To modify specific columns for a PK). Therefore I can not use a select *. (There are multiple scenarios this is just my current objective)
How can I generate a select statement on a table with all the column names in a sql statement. This would be equivalent of a 'Select top N' in SSMS where it generates a select for the table I can than edit.
I have seen functions like describe and show but they can't build a select statement.
I am new to Databricks. Any help is appreciated.
I have the same problem. It is really tough to make and modify SELECT statement for this kind of tables. I have tried many ways and found using the 3rd party software to connect to the table on Azure Databricks worked fine.
Here is what I do:
Download the 3rd party software such as DBeaver
Download Databricks JDBC driver form this page.
Configure Databricks driver. Luckily there is an official doc for DBeaver.
Connect to the Databricks and find the table to generate SELECT statement.
Use DBeaver built-in function to generate it. See the screenshot below.
That's it!
I found this setup took just 10-15 minutes to complete saving much time.
So I have been trying to replicate some oracle sql I have to redshift but I'm not too familiar with redshift, and I'm having some syntactical errors while replicating, I believe there's no FORCE in redshift, then how would i replicate this line of code from oracle sql to redshift sql. I have been getting syntax errors near FORCE
CREATE OR REPLACE FORCE EDITIONABLE VIEW "dev"."daily_rates" ("FR_CURRENCY", "CURRENCY", "C_DATE", "C_RATE") AS
SELECT DISTINCT GL.G_RATES.FR_CURRENCY, GL.G_RATES.CURRENCY,
GL.G_RATES.C_DATE, GL.G_RATES.CRATE
FROM GL.G_RATES
WHERE GL.G_RATES.C_T='Corporate'
FORCE makes objects without validating the query, if you are sure your query works you can ignore it.
Amazon Redshift CREATE VIEW Docs
EDITIONABLE is a feature in oracle that let you have several edition of same object in database and I don't know if any other DB engine out there has this feature, so I guess you have to remove those two options when you create your object in Redshift.
In IBM SQL Query, simple table creation query is not working, its give error -
No viable alternative at input 'CREATE TABLE'
I take query(for create table) from official site and its also give the same error.
Attached below (official site query) screenshot url
https://i.ibb.co/n78BrPd/officalsiteexample.png
The IBM SQL Query service allows you to run queries (SELECT statements) against data. The syntax reference only has SELECT, not CREATE TABLE. Thus, seeing the syntax error is expected.
I just want to ask the following questions below:
Are SQL error codes in Azure SQL database will also apply in Azure SQL Data Warehouse?
Can anyone point me the URL where I can find list of error codes that's specific only from Azure SQL data warehouse?
Cheers,
Jhessie
Yes, they are the same. Reference: MSDN Forum
To view all the error messages, you can execute this query on master:
select * from sys.messages;