import data from mysql to delta lake by spark-submit

Viewed 136

shell is:

spark-submit 
    --class "io.delta.connectors.spark.jdbc.ImportRunner" sql-delta-import.jar 
    --jdbc-url jdbc:mysql://root:password!@hadoop1:3306/db 
    --source test 
    --destination default.delta-table 
    --split-by id 
    --chunks 5 

1.error:

Exception in thread "main" org.apache.spark.sql.catalyst.parser.ParseException: 
Possibly unquoted identifier delta-table detected. Please consider quoting it with 
back-quotes as `delta-table`(line 1, pos 13)
== SQL ==
default.delta-table
-------------^^^
  1. when default.delta-table change to default.delta-table error change to:
Exception in thread "main" org.apache.spark.sql.catalyst.parser.ParseException: 
mismatched input '<EOF>' expecting {'ADD', 'AFTER', 'ALL', 'ALTER', 

--destination default.delta-table change to --destination /tmp/delta-table

Exception in thread "main" org.apache.spark.sql.catalyst.parser.ParseException: 
extraneous input '/' expecting {'ADD', ...

/tmp/delta-table created by spark-shell exists in hadoop.

i not know how to solve it

0 Answers
Related