I'm trying to create an external table in Hive from DynamoDB, with this command:
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`");
This schema has previously worked when working with this table in Redshift, but Hive gives this error (I can't copy the text itself because of the weirdness of AWS online consoles), in short, it says Unsupported Hive type: int
:
I haven't found this error anywhere else on the Internet, and INT/INTEGER is the default type in Hive, so I don't understand how it could at all appear here.
Would appreciate any help!
The scalar types in DynamoDB are number
, string
, binary
, Boolean
, and null
.
And according to this docs ExternalTableForDDB, number
can be mapped to BIGINT
or DOUBLE
in Hive.
Try BIGINT