我正在尝试将数据导入RDS中的一个表中。数据以拼花文件格式显示,并以s3格式显示。我考虑使用s3将数据从Sqoop导入HDFS,然后使用Sqoop将其导出到RDS表中。我找到了将数据从HDFS导出到RDS的命令。但是我找不到从S3导入拼花数据的方法。在这种情况下,请帮助您如何构造sqoop import命令。
发布于 2021-09-17 15:18:33
对我来说,似乎最简单和最好的方法如下:
create external table if not exists parquet_table(<column name> <column's datatype>) stored as parquet;
LOAD DATA INPATH 's3a://<bucket_name>/<parquet_file>' INTO table parquet_tablecreate external table if not exists csv_table(<column name> <column's datatype>)
row format delimited fields terminated by ','
stored as textfile
location 'hdfs:///user/hive/warehouse/csvdata'export --table <mysql_table_name> --export-dir hdfs:///user/hive/warehouse/csvdata --connect jdbc:mysql://<host>:3306/<db_name> --username <username> --password-file hdfs:///user/test/mysql.password --batch -m 1 --input-null-string "\\N" --input-null-non-string "\\N" --columns <column names to be exported, without whitespace in between the column names>https://stackoverflow.com/questions/69107946
复制相似问题