cmathiesen commented on a change in pull request #678: Add Java code examples and update site docs URL: https://github.com/apache/incubator-iceberg/pull/678#discussion_r372426386
########## File path: examples/README.md ########## @@ -0,0 +1,198 @@ +# Iceberg Java API Examples (with Spark) + +## About +Welcome! :smile: + +If you've stumbled across this module, hopefully you're looking for some guidance on how to get started with the [Apache Iceberg](https://iceberg.apache.org/) table format. This set of classes collects code examples of how to use the Iceberg Java API with Spark, along with some extra detail here in the README. + +The examples are structured as JUnit tests that you can download and run locally if you want to mess around with Iceberg yourself. + +## Using Iceberg +### Maven +If you'd like to try out Iceberg in your own project, you can use the `spark-iceberg-runtime` dependency: +```xml + <dependency> + <groupId>org.apache.iceberg</groupId> + <artifactId>iceberg-spark-runtime</artifactId> + <version>${iceberg.version}</version> + </dependency> +``` + +You'll also need `spark-sql`: +```xml + <dependency> + <groupId>org.apache.spark</groupId> + <artifactId>spark-sql_2.12</artifactId> + <version>2.4.4</version> + </dependency> +``` + +### Gradle +To add a dependency on Iceberg in Gradle, add the following to `build.gradle`: +``` +dependencies { + compile 'org.apache.iceberg:iceberg-core:0.7.0-incubating' +} +``` + +## Key features investigated +The following section will break down the different areas of Iceberg explored in the examples, with links to the code and extra information that could be useful for new users. + +### Writing data to tables +There are multiple ways of creating tables with Iceberg, including using the Hive Metastore to keep track of tables ([HiveCatalog](https://iceberg.apache.org/api-quickstart/#using-a-hive-catalog)), or using HDFS / your local file system ([HadoopTables](https://iceberg.apache.org/api-quickstart/#using-a-hive-catalog)) to store the tables. However, directory tables don’t support all catalog operations, like rename. Review comment: Thanks for pointing out that sentence - I've extended the sentence a bit to try make the meaning a bit clearer here :) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
