在Hive中从DynamoDB创建外部表失败,并显示“Unsupported Hive type:int”

yrefmtwq  于 12个月前  发布在  Hive
关注(0)|答案(1)|浏览(235)

我正在尝试从DynamoDB在Hive中创建一个外部表,使用以下命令:

create external table StoreData(rowid INT, order_priority STRING, 
discount FLOAT, unit_price FLOAT, shipping_cost FLOAT, customer_id INT,
customer_name STRING, ship_mode STRING, customer_segment STRING,
product_category STRING, product_subcategory STRING,
product_container STRING, product_name STRING, product_base_margin FLOAT,
country STRING, region STRING, state_or_province STRING, city STRING,
postal_code INT, order_date STRING, ship_date STRING, profit DOUBLE,
quantity_ordered_new INT, sales FLOAT, order_id INT)
stored by 'org.apache.hadoop.hive.dynamodb.DynamoDBStorageHandler' TBLPROPERTIES ("dynamodb.table.name" = "bigdataassignment1",
"dynamodb.column.mapping" = "rowid:`Row ID`,order_priority:`Order Priority`,
discount:Discount,unit_price:`Unit Price`,shipping_cost:`Shipping Cost`,
customer_id:`Customer ID`,customer_name:`Customer Name`,ship_mode:`Ship Mode`,
customer_segment:`Customer Segment`,product_category:`Product Category`,
product_subcategory:`Product Sub-Category`,product_container:`Product Container`,
product_name:`Product Name`,product_base_margin:`Product Base Margin`,
country:Country,region:Region,state_or_province:`State or Province`,city:City,
postal_code:`Postal Code`,order_date:`Order Date`,ship_date:`Ship Date`,
profit:Profit,quantity_ordered_new:`Quantity ordered new`,sales:Sales,order_id:`Order ID`");

字符串
这个模式以前在Redshift中处理这个表时可以工作,但是Hive给出了这个错误(由于AWS在线控制台的怪异性,我不能复制文本本身),简而言之,它说Unsupported Hive type: int:x1c 0d1x
我在互联网上的其他地方都没有发现这个错误,而INT/INTEGER是Hive的默认类型,所以我不明白它怎么会出现在这里。
将感谢任何帮助!

ha5z0ras

ha5z0ras1#

DynamoDB中的标量类型有numberstringbinaryBooleannull
根据文档ExternalTableForDDBnumber可以Map到Hive中的BIGINTDOUBLE
试试BIGINT

相关问题