anchor.diff:  :hivejarfile: solr-hive-serde-<version>.jar
   :hivejarfile013: solr-hive-serde-0.13-<version>.jar
  +:env-github:
   
   = Hive SerDe
   
  
positive.code: 
  From a Hive prompt, use the `ADD JAR` command and reference the path and filename of the SerDe jar for your Hive version.
  
  `hive> ADD JAR {hivejarfile};`
  
  This can also be done in your Hive command to create the table, as in the <<example-hive,example below>>.
  // end::install-hive[]
  
negative.code: 
  INSERT OVERWRITE TABLE solr SELECT b.* FROM books b;
  ----
  endif::[]
  
  ifndef::env-github[]
  [source,sql,subs="verbatim,attributes,callouts"]
  ----
  CREATE TABLE books (id STRING, cat STRING, title STRING, price FLOAT, in_stock BOOLEAN, author STRING, series STRING, seq INT, genre STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY ','; --<1>
  
  LOAD DATA LOCAL INPATH '/solr/example/exampledocs/books.csv' OVERWRITE INTO TABLE books; --<2>
  
  ADD JAR ${hivejarfile}; --<3>
  
  CREATE EXTERNAL TABLE solr (id STRING, cat_s STRING, title_s STRING, price_f FLOAT, in_stock_b BOOLEAN, author_s STRING, series_s STRING, seq_i INT, genre_s STRING) --<4>
       STORED BY 'com.lucidworks.hadoop.hive.LWStorageHandler' --<5>
       LOCATION '/tmp/solr' --<6>
       TBLPROPERTIES('solr.zkhost' = 'zknode1:2181,zknode2:2181,zknode3:2181/solr',
                     'solr.collection' = 'gettingstarted',
                     'solr.query' = '*:*'),
                     'lww.jaas.file' = '/data/jaas-client.conf'; --<7>
  
  
  INSERT OVERWRITE TABLE solr SELECT b.* FROM books b;
  ----
  endif::[]
  
  <1> Define the table `books`, and provide the field names and field types that will make up the table.
  <2> Load the data from the `books.csv` file.
  ifdef::env-github[]
  <3> Add the `{hivejarfile}` file to Hive. Note the jar name shown here omits the version information which will be included in the jar file you have. If you are using Hive 0.13, you must also use a jar specifically built for 0.13.
  endif::[]
  ifndef::env-github[]
  <3> Add the `${hivejarfile}` file to Hive. Note the jar name shown here omits the version information which will be included in the jar file you have. If you are using Hive 0.13, you must also use a jar specifically built for 0.13.
  endif::[]
  <4> Create an external table named `solr`, and provide the field names and field types that will make up the table. These will be the same field names as in your local Hive table, so we can index all of the same data to Solr.
  ifdef::env-github[]
  <5> Define the custom storage handler provided by the `{hivejarfile}`.
  endif::[]
  ifndef::env-github[]
  <5> Define the custom storage handler provided by the `${hivejarfile}`.
  endif::[]
  <6> Define storage location in HDFS.
  <7> Define the location of Solr (or ZooKeeper if using SolrCloud), the collection in Solr to index the data to, and the query to use when reading the table. This example also refers to a JAAS configuration file that will be used to authenticate to the Kerberized Solr cluster.
  
  // end::example-hive[]
  // end::using-serde[]
  