Hi Team,
Requesting you help. Is it possible to create a table using spark-sql like mentioned here (https://docs.databricks.com/spark/latest/data-sources/elasticsearch.html
[Use SQL to access Elasticsearch index])
I am able to create external table successfully on top of ES document using ES-hive using ESStorage Handler , however I am unable to create a table using spark-sql synstax ,and using below command.
create table elasticsearch_poc
using org.elasticsearch.spark.sql
options('resource'='indexname',
'nodes'= 'node name',
'es.nodes.wan.only'='true',
'es.port'='portnumber'
);
Below command is using to create table(successfully) using HIVE.
create external table elasticserach_test(col1 STRING,col2 STRING)
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'
TBLPROPERTIES(
'es.nodes'='nodeaddress',
'es.port'='portnumber',
'es.resource'='resourcenamet' ,
'es.nodes.wan.only' = 'true',
'es.nodes.discover'='true',
'es.mapping.names'='col1:col1,col2:col2'
)
Regards,
Srini