从数据湖导出到 Azure SQL Server 数据库时出现问题

Having issues exporting from data lake to Azure SLQ Server DB

我正在尝试使用 Sqoop 将数据从我的数据湖导出到我在 Azure SQL 服务器中设置的 table。这一切都在 Azure 数据工厂中。 table 的模式与文件名的模式匹配,但有一个例外......我在 table 中有一个名为 'file_name' 的列,我想从文件本身填充它(该字段不在原始数据中)。这是我试过的代码。

sqoop-export 
--connect "jdbc:sqlserver://server_name.database.windows.net:1433;username=user_name;password='pass word';database=db_name" 
--table REUTERS_CW 
--export-dir adl://rawdata/corp/file_name.gz 
--input-fields-terminated-by "|"

当我 运行 那个时,我得到这个错误:

<console>:10: error: identifier expected but string literal found.
--input-fields-terminated-by "|"

有三件事我不确定。

#1) My password actually has spaces in it; I think wrapping that in quotes will fix it.

#2) I'm running this in Scala in Azure Databricks; I'm guessing that's oen way to do it, but I don't know for sure.

#3) I'm not certain about how to copy the data from the file and simultaneously append the file name relative to the data that's supposed to be copied over.

我正在按照下面 link 中的示例进行操作。

https://docs.microsoft.com/en-us/azure/data-lake-store/data-lake-store-data-transfer-sql-sqoop

我从sqoop-export文档中得到的是它似乎不支持压缩文件。

可以参考sqoop-export Syntax.

sqoop-export:

--export-dir 参数和 --table--call 之一是必需的。这些指定 table 要填充到数据库(或要调用的存储过程),以及 HDFS 中包含源数据的目录。

sqoop-导入:

希望对您有所帮助。