Analyze Table Syntax Error - h2

The following sql statement raises a syntax error:
analyze table my_table sample_size 0;
This is the raised error:
Syntax error in SQL statement "ANALYZE TABLE MY_TABLE SAMPLE_SIZE[*] 0 "; expected "integer";
The official documentation gives the following:
ANALYZE [TABLE tableName] [SAMPLE_SIZE rowCountInt]
(...)
The value 0 means all rows are read.
How to workaround this problem?
H2 1.4.196

The error results from a bug in the h2 database parsing code. A fix has been sent.
I don't know in which version it willl be available.

Related

SubQuery works in IMPALA but not HIVE

I'm trying to understand why the following subquery will work in Impala and not Hive.
select * from MySchema.MyTable where identifier not in
(select identifier from schema.table where status_code in (1,2,3));
EDIT:
Added the error
Error while compiling statement: FAILED: SemanticException [Error
10249]: line 1:55 Unsupported SubQuery Expression 'identifier':
Correlating expression cannot contain unqualified column references.
Issue could be because of 'identifier' in both queries, in main query and inner subquery. Explicitly mentioning which 'identifier' you are referring to like 'mytable.identifier' should resolve this issue.
This is probably an issue with Hive that has been fixed in recent versions and issue is not reproduced in hive 3.1.0.
If you are still facing the issue, let us know the hive version you are using and DDL statements used to create tables.

DBLink from Oracle to Cassandra

For a training purpose, I am trying create a DBLink between Oracle 12c and Cassandra 3.9.0, both installed on local machine.
For this I performed the steps described in this link.
Unfortunately, in the end I finished with error message:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
Unable to retrieve columns for table [LOCAL]. {42000,NativeErr = -1}
ORA-02063: preceding 2 lines from TO_CASSANDRA
28500. 00000 - "connection from ORACLE to a non-Oracle system returned this message:"
*Cause: The cause is explained in the forwarded message.
*Action: See the non-Oracle system's documentation of the forwarded
message.
Can you give me some hints about what I am doing wrong, please?
Thank you,
The solution is more easier than I expected.
When I received the error, I used the following statement:
SELECT * from emp#mycassandradb WHERE empid = 1;
... and to solve it I used:
SELECT * from "emp"#mycassandradb WHERE "empid" = 1;
Hope it might be helpful for some others,

Error when trying to use the lag function in explicit-pass through [Hive] [SAS over Hadoop]

The following query is giving me the error:
Execute error: Error while processing statement: FAILED: Execution Error, return code 2 from
org.apache.hadoop.hive.ql.exec.mr.MapRedTask
Does anyone know why or how to resolve this issue?
proc sql;
connect to hadoop(server='xxx' port=10000 schema=xxx SUBPROTOCOL=hive2 sql_functions=all);
execute(
create table a as
select
*,
lag(claim_flg,1) over (order by ptnt_id,month) as lag1
from b
) by hadoop;
disconnect from hadoop;
quit;
It appears to be a limitation issue in HIVE database:
Hive Limit of 127 Expressions per Table
Due to a limitation in the Hive database, tables can contain a maximum of 127 expressions. When the 128th expression is read, the directive fails and the SAS log receives a message similar to the following:
ERROR: java.sql.SQLException: Error while processing statement: FAILED:
Execution Error, return
code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
ERROR: Unable to execute Hadoop query.
ERROR: Execute error.
SQL_IP_TRACE: None of the SQL was directly passed to the DBMS.
The Hive limitation applies anytime a table is read as part of a directive. For SAS Data Loader, the error can occur in aggregations, profiles, when viewing results, and when viewing sample data.
Source: http://support.sas.com/documentation/cdl/en/dmddug/67908/HTML/default/viewer.htm#p1fl149uastoudn1v7r2u5ff8aft.htm

How to solve : SQL Error: ORA-00604: error occurred at recursive SQL level 1

When I'm trying to drop table then I'm getting error
SQL Error: ORA-00604: error occurred at recursive SQL level 2
ORA-01422: exact fetch returns more than requested number of rows
00604. 00000 - "error occurred at recursive SQL level %s"
*Cause: An error occurred while processing a recursive SQL statement
(a statement applying to internal dictionary tables).
*Action: If the situation described in the next error on the stack
can be corrected, do so; otherwise contact Oracle Support.
One possible explanation is a database trigger that fires for each DROP TABLE statement. To find the trigger, query the _TRIGGERS dictionary views:
select * from all_triggers
where trigger_type in ('AFTER EVENT', 'BEFORE EVENT')
disable any suspicious trigger with
alter trigger <trigger_name> disable;
and try re-running your DROP TABLE statement
I noticed following line from error.
exact fetch returns more than requested number of rows
That means Oracle was expecting one row but It was getting multiple rows. And, only dual table has that characteristic, which returns only one row.
Later I recall, I have done few changes in dual table and when I executed dual table. Then found multiple rows.
So, I truncated dual table and inserted only row which X value. And, everything working fine.
I know the post is old and solved, but maybe someone is facing or will face my situation, so I want to leave the aquired knowledge here, after deal with the error for a week. I was facing the error: "ORA-00604: error occurred at recursive SQL level 1" , but with the internal error: " ORA-06502: error: character string buffer too smal numeric or value", this happened only when I try to logon the database, and using an specific driver, trying to connect from an Visual Studio C# application, the weirdest thing on that moment was that I connect from SQLDeveloper or TOAD and everything worked fine.
Later I discovered that my machine name had this format "guillermo-aX474b5", then I proceed to rename it like this "guillermo" without the "-" and the other stuff, and it worked!! Looks like in some drivers and situations, ORACLE Database does'nt like the "-" in the LogOn connection.
Hope it helps!

What is ORA-00604: error occurred at recursive SQL level string error?

I am getting this error while executing some query with progress 4GL on oracle db. Anybody have any information about this. I am using dynamic query to access 2 tables.
For each table1 no-lock where table1.field1 = "xyz",
First table2 no-lock where table2.field1 = 123 and table2.field2.
Here table2.field2 is logical.
When I use it as static query, I get records.
But when I use dynamic query using query prepare, there is no error in query prepare and query open,
but when I use query_handle:get-first, I am getting oracle error number 604

Resources