存在从数据湖导出到Azure SLQ Server DB的问题

问题描述 投票:0回答:1

我正在尝试使用Sqoop将数据从数据湖导出到我在Azure SQL Server中设置的表中。这一切都在Azure数据工厂中。该表的模式与文件名的模式匹配,但有一个例外...我在表中有一个名为“ 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.

我正在下面的链接中查看示例。

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

scala azure sqoop azure-data-factory azure-data-lake
1个回答
0
投票
您可以参考sqoop-export Syntax

sqoop-export:

enter image description here--export-dir参数和--table--call之一是必需的。它们指定要在数据库(或要调用的存储过程)中填充的表,以及HDFS中包含源数据的目录。

sqoop-import

enter image description here

希望这会有所帮助。
© www.soinside.com 2019 - 2024. All rights reserved.