Support Questions
Find answers, ask questions, and share your expertise

es.resource explanation

Master Collaborator

I am not understanding how does es.resource or es.mapping.id works . how did the TBLPROPERTIES created the mappings shown below?

CREATE EXTERNAL TABLE pa_lane_txn_es (
    txn_id      BIGINT,
    ext_plaza_id    STRING,
    toll_amt_collected BIGINT,
    toll_amt_full BIGINT,
    ext_lane_id   STRING)
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'
TBLPROPERTIES('es.resource' = 'lane_txn/txn_id','es.mapping.id'='txn_id','es.nodes' = '127.0.0.1:9200');


[root@hadoop5 ~]# curl -XGET 'http://localhost:9200/_mapping?pretty=true'
{
  "lane_txn" : {
    "mappings" : {
      "txn_id" : {
        "properties" : {
          "ext_lane_id" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "ext_plaza_id" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          },
          "toll_amt_collected" : {
            "type" : "long"
          },
          "toll_amt_full" : {
            "type" : "long"
          },
          "txn_id" : {
            "type" : "long"
          }
        }
      }
    }
  }





1 REPLY 1

Master Collaborator

why I am not getting any replies ?