Sqoop avro java 来自文件的列映射
Sqoop avro java column mapping from file
我正在使用 sqoop 使用以下查询以 avro 格式将数据从 oracle 导出到 hdfs
sqoop import --connection-param-file ora.properties --connect jdbc:oracle:thin:@//host:port/servicename --username <user> --password-file <password-file> --map-column-java TRADE_NUM=Integer,STRATEGY_NUM=Integer,COMMISSION_AMT=Double,TRADE_INPUT_DT=String --query "SELECT * FROM XYZ WHERE $CONDITIONS " --target-dir <location on hdfs> --delete-target-dir --split-by TRADE_NUM --verbose --compress --as-avrodatafile
我想从文件传递映射 (--map-column-java) 而不是从命令行提供,是否有这样做的选项,请建议。
您可以使用选项文件将参数传递给Sqoop。根据 documentation,您可以使用选项 --options-file
来指定包含参数的文件。
When using Sqoop, the command line options that do not change from invocation to invocation can be put in an options file for convenience. An options file is a text file where each line identifies an option in the order that it appears otherwise on the command line (...)
Option files can be specified anywhere in the command line as long as the options within them follow the otherwise prescribed rules of options ordering.
我正在使用 sqoop 使用以下查询以 avro 格式将数据从 oracle 导出到 hdfs
sqoop import --connection-param-file ora.properties --connect jdbc:oracle:thin:@//host:port/servicename --username <user> --password-file <password-file> --map-column-java TRADE_NUM=Integer,STRATEGY_NUM=Integer,COMMISSION_AMT=Double,TRADE_INPUT_DT=String --query "SELECT * FROM XYZ WHERE $CONDITIONS " --target-dir <location on hdfs> --delete-target-dir --split-by TRADE_NUM --verbose --compress --as-avrodatafile
我想从文件传递映射 (--map-column-java) 而不是从命令行提供,是否有这样做的选项,请建议。
您可以使用选项文件将参数传递给Sqoop。根据 documentation,您可以使用选项 --options-file
来指定包含参数的文件。
When using Sqoop, the command line options that do not change from invocation to invocation can be put in an options file for convenience. An options file is a text file where each line identifies an option in the order that it appears otherwise on the command line (...) Option files can be specified anywhere in the command line as long as the options within them follow the otherwise prescribed rules of options ordering.