0
votes

I am trying to do an insert into an existing table, but receive incorrect syntax error:

Statement:

vc.sql("insert into table HIST_TEMP values (0, 'AAA','2010-06-01', 30.5, 12.0)")

Error:

org.apache.spark.sql.SapParserException: Syntax error at or near line 1, column 36

insert into table HIST_TEMP values (0, 'AAA','2010-06-01', 30.5, 12.0)

at org.apache.spark.sql.SapSqlParser$.parse(SapSqlParser.scala:176)

Table:

vc.sql(s"""
CREATE TABLE HIST_TEMP(
        INSTRUMENT_ID INT,
        TRADING_SYMBOL VARCHAR(5),
        TRADE_DATE DATE,
        CLOSE_PRICE DOUBLE,
        SPLIT_FACTOR DOUBLE)           
USING com.sap.spark.vora
OPTIONS (tableName "HIST_TEMP",
                 hosts "$vHost",
                 zkurls "localhost:2181") """)
2

2 Answers

1
votes

Vora currently only officially supports appending data to an existing table (using the APPEND statement). For details see SAP HANA Vora Developer Guide -> Chapter "3.5 Appending Data to Existing Tables"

0
votes

The syntax for the insert should be

insert into <tablename> (col1, col2, col3...) values('val1', 'val2', 'val3'...);

Gopal