Impala JDBC Reader -- sql statement error with 2 sql executed


(sivaraman gangadharan) #1

Hello ,
I have created Impala JDBC connection and able tos successfully connect to read data from a table . I have issue in executing 2 sql statements at one time , like in Impala you have to issue refresh table name before reading the table from CDH .

Invalidate metadata tablename has to be issued in Impala before reading from a table . please let me know how is it possible for me to execute both these statements before profiling the data for hl7_acc table in CDH .

syntax
Invalidate Metadata hl7.hl7_acc;
select * from hl7_acc
where message_control_id=‘E318785’;

Error:

[Simba]ImpalaJDBCDriver ERROR processing query/statement. Error Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS, sqlState:HY000, errorMessage:AnalysisException: Syntax error in line 2:
select * from hl7_acc
^
Encountered: SELECT
Expected

CAUSED BY: Exception: Syntax error
), Query: Invalidate Metadata hl7.hl7_acc;
select * from hl7_acc
where message_control_id=‘E318785’;.
while executing Invalidate Metadata hl7.hl7_acc;
select * from hl7_acc
where message_control_id=‘E318785’;


#2

Hi Sivaraman!

Unfortunately, it is not possible to use JDBC Reader step for the SQL queries that are not related to Select statements. However, there is an easy solution for this:
You can create a workflow with a Execute SQL WF task. In this task, you can send the “invalidate metadata” statement. After this WF task, you can run your plan with selecting the data.

Let us know if it worked for you.

Regards,
Vladimir