Farahzalina Yusof
2018-11-23 02:23:06 UTC
I tried to create mongodb-based hive table following the guidelines in
https://github.com/mongodb/mongo-hadoop/wiki/Hive-Usage
create external table mongoTest(
id String,age String,gender String,race String,custState String,purchaseDate
String,purchaseTime String,foodname String,restaurant String,foodtype String
,quantity String,totalPrice String,orderType String,rating String,servingType
String,characteristicString,restaurantType String,restaurantState String,priceRange
String,paymentMethod String,tableBooking String,onlineBooking String,deliveryService
String)
STORED BY 'com.mongodb.hadoop.hive.MongoStorageHandler'
WITH SERDEPROPERTIES('mongo.columns.mapping'='{"id":"_id","age":"age","gender":"gender","race":"race","custState":"custState
","purchaseDate":"purchaseDate","purchaseTime":"purchaseTime","foodname":"foodname","restaurant":"restaurant","foodtype":"foodtype","quantity":"quantity","totalPrice":"totalPrice","orderType":"orderType","rating":"rating","servingType":"servingType","characteristic":"characteristic","restaurantType":"restaurantType",
"restaurantState":"restaurantState","priceRange":"priceRange","paymentMethod":"paymentMethod","tableBooking":"tableBooking","onlineBooking":"onlineBooking","deliveryService":"deliveryService"}'
)
TBLPROPERTIES('mongo.uri'='mongodb://master:27017/bigdatadb.datasetv1');
but then i got this error:
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.
DDLTask. org/apache/hadoop/hive/serde2/SerDe
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/d38193ba-40d9-4762-bd31-2805d5d5dac1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
https://github.com/mongodb/mongo-hadoop/wiki/Hive-Usage
create external table mongoTest(
id String,age String,gender String,race String,custState String,purchaseDate
String,purchaseTime String,foodname String,restaurant String,foodtype String
,quantity String,totalPrice String,orderType String,rating String,servingType
String,characteristicString,restaurantType String,restaurantState String,priceRange
String,paymentMethod String,tableBooking String,onlineBooking String,deliveryService
String)
STORED BY 'com.mongodb.hadoop.hive.MongoStorageHandler'
WITH SERDEPROPERTIES('mongo.columns.mapping'='{"id":"_id","age":"age","gender":"gender","race":"race","custState":"custState
","purchaseDate":"purchaseDate","purchaseTime":"purchaseTime","foodname":"foodname","restaurant":"restaurant","foodtype":"foodtype","quantity":"quantity","totalPrice":"totalPrice","orderType":"orderType","rating":"rating","servingType":"servingType","characteristic":"characteristic","restaurantType":"restaurantType",
"restaurantState":"restaurantState","priceRange":"priceRange","paymentMethod":"paymentMethod","tableBooking":"tableBooking","onlineBooking":"onlineBooking","deliveryService":"deliveryService"}'
)
TBLPROPERTIES('mongo.uri'='mongodb://master:27017/bigdatadb.datasetv1');
but then i got this error:
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.
DDLTask. org/apache/hadoop/hive/serde2/SerDe
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/d38193ba-40d9-4762-bd31-2805d5d5dac1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.