I am writing a shell script to load data from a hive table into Apache solr schema.
SRC=$1
TGT=$2
SOLR_COLLECTION=$3
SCHEMA=$(python schemaFetch.py ${SRC})
hive -e "ADD JAR /hadoopfs/fs1/dev/solr-hive-serde-3.0.0.jar;
create external table if not exists ${TGT}${SCHEMA}
row format delimited
fields terminated by ','
STORED BY 'com.lucidworks.hadoop.hive.LWStorageHandler'
TBLPROPERTIES('solr.server.url' = 'http://10.165.137.139:8886/solr/',
'solr.collection' = '${SOLR_COLLECTION}',
'solr.query' = '*:*');"
hive -e "insert into ${TGT} select * from ${SRC};"
But it is showing a runtime exception:
FAILED: RuntimeException org.apache.hadoop.hive.ql.metadata.HiveException: Error in loading storage handler.com.lucidworks.hadoop.hive.LWStorageHandler
Yet also schema is being created in particular hive location and below listed insert into query is not working from the script.
hive -e "insert into ${TGT} select * from ${SRC};
I do not get what is happening.