Skip to content

Commit

Permalink
output format solr
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitalii Cherkashyn authored Jul 28, 2019
1 parent 2042475 commit b5ef2c7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion spark.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,12 @@ jdbcDF.write
```
dataframe.write.option("path", "/some/path").saveAsTable("some_table_name")
```
* Solr
```scala
// Generate unique key if the 'id' field does not exist
val options = Map("zkhost" -> "134.191.209.235:2181/solr", "collection" -> "label_collection", "gen_uniq_key" -> "true")
dataframe.write.format("solr").options(options).mode(org.apache.spark.sql.SaveMode.Overwrite).save
```

### append data, union data
```
Expand Down Expand Up @@ -608,7 +614,7 @@ spark-shell -i /path/to/file.scala
END_FILE_MARKER
```

## execute shell wit additional jar and in debug mode and multi-config lines
## execute shell with additional jar, in debug mode
```
spark-shell \
--jars "/home/some_path/solr-rest_2.11-0.1.jar,/home/someuser/.ivy2/cache/org.json/json/bundles/json-20180813.jar" \
Expand Down

0 comments on commit b5ef2c7

Please sign in to comment.