1
我想將HDFS中的數據導出到架構my_schema
中的SQL Server表中。Sqoop導出到SQL Server:模式?
我試着像--schema
導入命令:
sqoop export \
--libjars /opt/mapr/sqoop/sqoop-1.4.6/lib/sqljdbc4.jar \
--connect "jdbc:sqlserver://MY-SERVER-DNS;database=my_db;" \
--schema "myschema" \
--table "my_table" \
--export-dir /path/to/my/hdfs/dir
ERROR tool.BaseSqoopTool: Unrecognized argument: --schema
而且--table "schema.table"
sqoop export \
--libjars /opt/mapr/sqoop/sqoop-1.4.6/lib/sqljdbc4.jar \
--connect "jdbc:sqlserver://MY-SERVER-DNS;database=my_db;" \
--table "my_schema.my_table" \
--export-dir /path/to/my/hdfs/dir
INFO manager.SqlManager:
Executing SQL statement: SELECT t.* FROM [my_schema.my_table] AS t WHERE 1=0
ERROR manager.SqlManager: Error executing statement:
com.microsoft.sqlserver.jdbc.SQLServerException:
Invalid object name 'my_schema.my_table'.
有沒有辦法用sqoop做到這一點?還是另一種技術?
編輯:
sqoop export \
--libjars /opt/mapr/sqoop/sqoop-1.4.6/lib/sqljdbc4.jar \
--connect "jdbc:sqlserver://MY-SERVER-DNS;database=my_db;schema=my_schema;" \
--table "my_table" \
--export-dir /path/to/my/hdfs/dir
INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM [my_table] AS t WHERE 1=0
16/07/25 10:46:21 ERROR manager.SqlManager:
Error executing statement: com.microsoft.sqlserver.jdbc.SQLServerException:
Invalid object name 'my_table'.
這是不承認的模式。
第2版爲我工作。謝謝! – zemekeneng