在 Hive 中从 DynamoDB 创建外部表失败,并显示“不支持的 Hive 类型:int”

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

我正在尝试使用以下命令从 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

我在互联网上的其他地方没有发现这个错误,并且 INT/INTEGER 是 Hive 中的默认类型,所以我不明白它怎么会出现在这里。

非常感谢任何帮助!

amazon-web-services hive amazon-dynamodb
1个回答
0
投票

DynamoDB 中的标量类型为

number
string
binary
Boolean
null

根据此文档ExternalTableForDDB

number
可以映射到Hive中的
BIGINT
DOUBLE

尝试

BIGINT

© www.soinside.com 2019 - 2024. All rights reserved.