You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/08/12 04:37:04 UTC

[GitHub] [iceberg] cobookman opened a new pull request #2963: Docs: Clarify ObjectStoreLocationProvider

cobookman opened a new pull request #2963:
URL: https://github.com/apache/iceberg/pull/2963


   Clarified the description on ObjectStoreLocationProvider on that it generates a deterministic hash based on the filename, and that the hash is placed after `write.object-storage.path`.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] szehon-ho commented on a change in pull request #2963: Docs: Clarify ObjectStoreLocationProvider

Posted by GitBox <gi...@apache.org>.
szehon-ho commented on a change in pull request #2963:
URL: https://github.com/apache/iceberg/pull/2963#discussion_r688163674



##########
File path: site/docs/aws.md
##########
@@ -340,10 +340,9 @@ For more details, please read [S3 ACL Documentation](https://docs.aws.amazon.com
 ### Object Store File Layout
 
 S3 and many other cloud storage services [throttle requests based on object prefix](https://aws.amazon.com/premiumsupport/knowledge-center/s3-request-limit-avoid-throttling/). 
-This means data stored in a traditional Hive storage layout has bad read and write throughput since data files of the same partition are placed under the same prefix.
-Iceberg by default uses the Hive storage layout, but can be switched to use a different `ObjectStoreLocationProvider`.
-In this mode, a hash string is added to the beginning of each file path, so that files are equally distributed across all prefixes in an S3 bucket.
-This results in minimized throttling and maximized throughput for S3-related IO operations.
+Data stored in a traditional Hive storage layout can face bad read and write throughput as single table is stored under the same filepath prefix.

Review comment:
       Nit: "a single table"




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] cobookman edited a comment on pull request #2963: Docs: Clarify ObjectStoreLocationProvider

Posted by GitBox <gi...@apache.org>.
cobookman edited a comment on pull request #2963:
URL: https://github.com/apache/iceberg/pull/2963#issuecomment-898187675






-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] cobookman edited a comment on pull request #2963: Docs: Clarify ObjectStoreLocationProvider

Posted by GitBox <gi...@apache.org>.
cobookman edited a comment on pull request #2963:
URL: https://github.com/apache/iceberg/pull/2963#issuecomment-898187675


   > @cobookman the PR referenced is merged, could you update the documentation with the correct path resolution strategy? Thank you!
   
   Happy to, just want to understand what the expected write behaviour is for folder-storage & s3. Having the following fail on my end.
   ```
   CREATE TABLE my_catalog.my_ns.my_table (
       id bigint,
       data string,
       category string)
   USING iceberg
   OPTIONS (
       'write.object-storage.enabled'=true, 
       'write.folder-storage.path'='s3://some-bucket/some-random-folder/')
   PARTITIONED BY (category);
   
   INSERT INTO my_catalog.my_ns.my_table VALUES (1, "some data", "some category");
   java.lang.NullPointerException
   	at org.apache.iceberg.LocationProviders.stripTrailingSlash(LocationProviders.java:135)
   	at org.apache.iceberg.LocationProviders.access$000(LocationProviders.java:34)
   	at org.apache.iceberg.LocationProviders$ObjectStoreLocationProvider.<init>(LocationProviders.java:99)
   	at org.apache.iceberg.LocationProviders.locationsFor(LocationProviders.java:65)
   	at org.apache.iceberg.BaseMetastoreTableOperations.locationProvider(BaseMetastoreTableOperations.java:200)
   	at org.apache.iceberg.BaseTable.locationProvider(BaseTable.java:219)
   	at org.apache.iceberg.spark.source.SparkWrite.createWriterFactory(SparkWrite.java:172)
   	at org.apache.iceberg.spark.source.SparkWrite.access$600(SparkWrite.java:87)
   	at org.apache.iceberg.spark.source.SparkWrite$BaseBatchWrite.createBatchWriterFactory(SparkWrite.java:226)
   ```
   
   Omitting the `'write.object-storage.enabled'=true` Option seems to have avoided the NULL Pointer exception.
   ```
   spark-sql> CREATE TABLE my_catalog.my_ns.my_table (
            >     id bigint,
            >     data string,
            >     category string)
            > USING iceberg
            > OPTIONS (
            >     'write.folder-storage.path'='s3://some-bucket/some-random-folder/')
            > PARTITIONED BY (category);
   Time taken: 2.021 seconds
   spark-sql> INSERT INTO my_catalog.my_ns.my_table VALUES (1, "some data", "some category");
   Time taken: 3.968 seconds
   ```
   
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] jackye1995 edited a comment on pull request #2963: Docs: Clarify ObjectStoreLocationProvider

Posted by GitBox <gi...@apache.org>.
jackye1995 edited a comment on pull request #2963:
URL: https://github.com/apache/iceberg/pull/2963#issuecomment-898209403


   @cobookman The new resolution strategy is the following:
   - if `write.object-storage.path` is set, use it
   - if not found, fallback to `write.folder-storage.path`
   - if not found, use `<tableLocation>/data`
   
   I think you are testing using an older version. I have added some more tests in Spark SQL, in case you want some examples: https://github.com/apache/iceberg/pull/2966/files
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] cobookman commented on a change in pull request #2963: Docs: Clarify ObjectStoreLocationProvider

Posted by GitBox <gi...@apache.org>.
cobookman commented on a change in pull request #2963:
URL: https://github.com/apache/iceberg/pull/2963#discussion_r688968140



##########
File path: site/docs/aws.md
##########
@@ -358,6 +361,16 @@ OPTIONS (
 PARTITIONED BY (category);
 ```
 
+We can then insert a single row into this new table
+```SQL
+INSERT INTO my_catalog.my_ns.my_table VALUES (1, "Pizza", "orders");
+```
+
+Which will cause the following object to be written to S3:
+```
+s3://my-table-data-bucket/2d3905f8/my_ns.db/my_table/category=orders/00000-0-5affc076-96a4-48f2-9cd2-d5efbc9f0c94-00001.parquet
+```
+

Review comment:
       added

##########
File path: site/docs/aws.md
##########
@@ -339,13 +339,16 @@ For more details, please read [S3 ACL Documentation](https://docs.aws.amazon.com
 
 ### Object Store File Layout
 
-S3 and many other cloud storage services [throttle requests based on object prefix](https://aws.amazon.com/premiumsupport/knowledge-center/s3-request-limit-avoid-throttling/). 
-This means data stored in a traditional Hive storage layout has bad read and write throughput since data files of the same partition are placed under the same prefix.
-Iceberg by default uses the Hive storage layout, but can be switched to use a different `ObjectStoreLocationProvider`.
-In this mode, a hash string is added to the beginning of each file path, so that files are equally distributed across all prefixes in an S3 bucket.
+S3 and many other cloud storage services [throttle requests based on object prefix](https://aws.amazon.com/premiumsupport/knowledge-center/s3-request-limit-avoid-throttling/).
+Data stored on S3 in a traditional Hive storage layout can face S3 API request throttling as objects are stored under the same filepath prefix.
+
+Iceberg by default uses the Hive storage layout, but can be switched to use the `ObjectStoreLocationProvider`. 
+With `ObjectStoreLocationProvider`, a determenistic hash is generated for each stored file, with the hash appended 
+directly after the `write.object-storage.path`. This ensures files written to s3 are equally distributed across multiple prefixes in the S3 bucket.
 This results in minimized throttling and maximized throughput for S3-related IO operations.
-Here is an example Spark SQL command to create a table with this feature enabled:
 
+To use the `ObjectStorageLocationProvider` you just need to add `'write.object-storage.enabled'=true` in the table's `OPTIONS`. 

Review comment:
       fixed.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] jackye1995 commented on a change in pull request #2963: Docs: Clarify ObjectStoreLocationProvider

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #2963:
URL: https://github.com/apache/iceberg/pull/2963#discussion_r688690895



##########
File path: site/docs/aws.md
##########
@@ -358,6 +361,16 @@ OPTIONS (
 PARTITIONED BY (category);
 ```
 
+We can then insert a single row into this new table
+```SQL
+INSERT INTO my_catalog.my_ns.my_table VALUES (1, "Pizza", "orders");
+```
+
+Which will cause the following object to be written to S3:
+```
+s3://my-table-data-bucket/2d3905f8/my_ns.db/my_table/category=orders/00000-0-5affc076-96a4-48f2-9cd2-d5efbc9f0c94-00001.parquet
+```
+

Review comment:
       add an explanation like "2d3905f8 is a hash generated based on the original folder-based path, so that all the file reads are evenly distributed across the S3 bucket"




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] cobookman edited a comment on pull request #2963: Docs: Clarify ObjectStoreLocationProvider

Posted by GitBox <gi...@apache.org>.
cobookman edited a comment on pull request #2963:
URL: https://github.com/apache/iceberg/pull/2963#issuecomment-898187675


   > @cobookman the PR referenced is merged, could you update the documentation with the correct path resolution strategy? Thank you!
   
   Happy to, just want to understand what the expected write behaviour is for folder-storage & s3. Having the following fail on my end.
   ```
   CREATE TABLE my_catalog.my_ns.my_table (
       id bigint,
       data string,
       category string)
   USING iceberg
   OPTIONS (
       'write.object-storage.enabled'=true, 
       'write.folder-storage.path'='s3://some-bucket/some-random-folder/')
   PARTITIONED BY (category);
   
   INSERT INTO my_catalog.my_ns.my_table VALUES (1, "some data", "some category");
   java.lang.NullPointerException
   	at org.apache.iceberg.LocationProviders.stripTrailingSlash(LocationProviders.java:135)
   	at org.apache.iceberg.LocationProviders.access$000(LocationProviders.java:34)
   	at org.apache.iceberg.LocationProviders$ObjectStoreLocationProvider.<init>(LocationProviders.java:99)
   	at org.apache.iceberg.LocationProviders.locationsFor(LocationProviders.java:65)
   	at org.apache.iceberg.BaseMetastoreTableOperations.locationProvider(BaseMetastoreTableOperations.java:200)
   	at org.apache.iceberg.BaseTable.locationProvider(BaseTable.java:219)
   	at org.apache.iceberg.spark.source.SparkWrite.createWriterFactory(SparkWrite.java:172)
   	at org.apache.iceberg.spark.source.SparkWrite.access$600(SparkWrite.java:87)
   	at org.apache.iceberg.spark.source.SparkWrite$BaseBatchWrite.createBatchWriterFactory(SparkWrite.java:226)
   ```
   
   Omitting the `'write.object-storage.enabled'=true` Option seems to have avoided the NULL Pointer exception.
   ```
   spark-sql> CREATE TABLE my_catalog.sampledb.test_three (
            >     id bigint,
            >     data string,
            >     category string)
            > USING iceberg
            > OPTIONS (
            >     'write.folder-storage.path'='s3://kda-jython-test/some-random-folder/')
            > PARTITIONED BY (category);
   Time taken: 2.021 seconds
   spark-sql> INSERT INTO my_catalog.sampledb.test_three VALUES (1, "some data", "some category");
   Time taken: 3.968 seconds
   ```
   
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] jackye1995 commented on pull request #2963: Docs: Clarify ObjectStoreLocationProvider

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on pull request #2963:
URL: https://github.com/apache/iceberg/pull/2963#issuecomment-897879632


   Thanks for rewording this and provide more clarification!
   
   There is an ongoing PR #2845 to finalize the exact way that `ObjectStorageLocationProvider` resolves the root path. Let's wait for that to finalize and then update accordingly before merging this change.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] jackye1995 commented on a change in pull request #2963: Docs: Clarify ObjectStoreLocationProvider

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #2963:
URL: https://github.com/apache/iceberg/pull/2963#discussion_r688693253



##########
File path: site/docs/aws.md
##########
@@ -358,6 +361,16 @@ OPTIONS (
 PARTITIONED BY (category);
 ```
 
+We can then insert a single row into this new table
+```SQL
+INSERT INTO my_catalog.my_ns.my_table VALUES (1, "Pizza", "orders");
+```
+
+Which will cause the following object to be written to S3:
+```
+s3://my-table-data-bucket/2d3905f8/my_ns.db/my_table/category=orders/00000-0-5affc076-96a4-48f2-9cd2-d5efbc9f0c94-00001.parquet
+```
+

Review comment:
       And "the shorter the shared S3 prefix is, the better performance we will get. So it is recommended to use a root bucket as your object storage path to achieve best performance."
   
   Then we can talk about the path resolution strategy `write.object-storage.path` -> `write.folder-storage.path` -> table's default root location + `/data`




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] jackye1995 commented on pull request #2963: Docs: Clarify ObjectStoreLocationProvider

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on pull request #2963:
URL: https://github.com/apache/iceberg/pull/2963#issuecomment-898209403


   @cobookman The new resolution strategy is the following:
   - if write.object-storage.path is set, use it
   - if not found, fallback to write.folder-storage.path
   - if not found, use <tableLocation>/data
   
   I think you are testing using an older version. I have added some more tests in Spark SQL, in case you want some examples: https://github.com/apache/iceberg/pull/2966/files
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] cobookman commented on pull request #2963: Docs: Clarify ObjectStoreLocationProvider

Posted by GitBox <gi...@apache.org>.
cobookman commented on pull request #2963:
URL: https://github.com/apache/iceberg/pull/2963#issuecomment-898187675


   > @cobookman the PR referenced is merged, could you update the documentation with the correct path resolution strategy? Thank you!
   
   Happy to, just want to understand what the expected write behaviour is for folder-storage & s3. Having the following fail on my end.
   ```
   CREATE TABLE my_catalog.sampledb.my_table (
       id bigint,
       data string,
       category string)
   USING iceberg
   OPTIONS (
       'write.object-storage.enabled'=true, 
       'write.folder-storage.path'='s3://kda-jython-test/some-random-folder/')
   PARTITIONED BY (category);
   
   INSERT INTO my_catalog.sampledb.my_table VALUES (1, "some data", "some category");
   java.lang.NullPointerException
   	at org.apache.iceberg.LocationProviders.stripTrailingSlash(LocationProviders.java:135)
   	at org.apache.iceberg.LocationProviders.access$000(LocationProviders.java:34)
   	at org.apache.iceberg.LocationProviders$ObjectStoreLocationProvider.<init>(LocationProviders.java:99)
   	at org.apache.iceberg.LocationProviders.locationsFor(LocationProviders.java:65)
   	at org.apache.iceberg.BaseMetastoreTableOperations.locationProvider(BaseMetastoreTableOperations.java:200)
   	at org.apache.iceberg.BaseTable.locationProvider(BaseTable.java:219)
   	at org.apache.iceberg.spark.source.SparkWrite.createWriterFactory(SparkWrite.java:172)
   	at org.apache.iceberg.spark.source.SparkWrite.access$600(SparkWrite.java:87)
   	at org.apache.iceberg.spark.source.SparkWrite$BaseBatchWrite.createBatchWriterFactory(SparkWrite.java:226)
   ```


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] jackye1995 commented on a change in pull request #2963: Docs: Clarify ObjectStoreLocationProvider

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #2963:
URL: https://github.com/apache/iceberg/pull/2963#discussion_r688691483



##########
File path: site/docs/aws.md
##########
@@ -339,13 +339,16 @@ For more details, please read [S3 ACL Documentation](https://docs.aws.amazon.com
 
 ### Object Store File Layout
 
-S3 and many other cloud storage services [throttle requests based on object prefix](https://aws.amazon.com/premiumsupport/knowledge-center/s3-request-limit-avoid-throttling/). 
-This means data stored in a traditional Hive storage layout has bad read and write throughput since data files of the same partition are placed under the same prefix.
-Iceberg by default uses the Hive storage layout, but can be switched to use a different `ObjectStoreLocationProvider`.
-In this mode, a hash string is added to the beginning of each file path, so that files are equally distributed across all prefixes in an S3 bucket.
+S3 and many other cloud storage services [throttle requests based on object prefix](https://aws.amazon.com/premiumsupport/knowledge-center/s3-request-limit-avoid-throttling/).
+Data stored on S3 in a traditional Hive storage layout can face S3 API request throttling as objects are stored under the same filepath prefix.
+
+Iceberg by default uses the Hive storage layout, but can be switched to use the `ObjectStoreLocationProvider`. 
+With `ObjectStoreLocationProvider`, a determenistic hash is generated for each stored file, with the hash appended 
+directly after the `write.object-storage.path`. This ensures files written to s3 are equally distributed across multiple prefixes in the S3 bucket.
 This results in minimized throttling and maximized throughput for S3-related IO operations.
-Here is an example Spark SQL command to create a table with this feature enabled:
 
+To use the `ObjectStorageLocationProvider` you just need to add `'write.object-storage.enabled'=true` in the table's `OPTIONS`. 

Review comment:
       in the table's properties. (because `OPTIONS` and `TBLPROPERTIES` are used interchangeably)




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] jackye1995 merged pull request #2963: Docs: Clarify ObjectStoreLocationProvider

Posted by GitBox <gi...@apache.org>.
jackye1995 merged pull request #2963:
URL: https://github.com/apache/iceberg/pull/2963


   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] cobookman edited a comment on pull request #2963: Docs: Clarify ObjectStoreLocationProvider

Posted by GitBox <gi...@apache.org>.
cobookman edited a comment on pull request #2963:
URL: https://github.com/apache/iceberg/pull/2963#issuecomment-898187675


   > @cobookman the PR referenced is merged, could you update the documentation with the correct path resolution strategy? Thank you!
   
   Happy to, just want to understand what the expected write behaviour is for folder-storage & s3. Having the following fail on my end.
   ```
   CREATE TABLE my_catalog.my_ns.my_table (
       id bigint,
       data string,
       category string)
   USING iceberg
   OPTIONS (
       'write.object-storage.enabled'=true, 
       'write.folder-storage.path'='s3://some-bucket/some-random-folder/')
   PARTITIONED BY (category);
   
   INSERT INTO my_catalog.my_ns.my_table VALUES (1, "some data", "some category");
   java.lang.NullPointerException
   	at org.apache.iceberg.LocationProviders.stripTrailingSlash(LocationProviders.java:135)
   	at org.apache.iceberg.LocationProviders.access$000(LocationProviders.java:34)
   	at org.apache.iceberg.LocationProviders$ObjectStoreLocationProvider.<init>(LocationProviders.java:99)
   	at org.apache.iceberg.LocationProviders.locationsFor(LocationProviders.java:65)
   	at org.apache.iceberg.BaseMetastoreTableOperations.locationProvider(BaseMetastoreTableOperations.java:200)
   	at org.apache.iceberg.BaseTable.locationProvider(BaseTable.java:219)
   	at org.apache.iceberg.spark.source.SparkWrite.createWriterFactory(SparkWrite.java:172)
   	at org.apache.iceberg.spark.source.SparkWrite.access$600(SparkWrite.java:87)
   	at org.apache.iceberg.spark.source.SparkWrite$BaseBatchWrite.createBatchWriterFactory(SparkWrite.java:226)
   ```
   
   Omitting the `'write.object-storage.enabled'=true` avoids the NULL Pointer exception, but also falls back to the hive driver, writing data to:
   `s3://some-bucket/some-random-folder/category=some+category/00000-2-13441dd2-137a-42d1-9c6b-9ccc29a2ebeb-00001.parquet`
   
   ```
   spark-sql> CREATE TABLE my_catalog.my_ns.my_table (
            >     id bigint,
            >     data string,
            >     category string)
            > USING iceberg
            > OPTIONS (
            >     'write.folder-storage.path'='s3://some-bucket/some-random-folder/')
            > PARTITIONED BY (category);
   Time taken: 2.021 seconds
   spark-sql> INSERT INTO my_catalog.my_ns.my_table VALUES (1, "some data", "some category");
   Time taken: 3.968 seconds
   ```
   
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] jackye1995 commented on pull request #2963: Docs: Clarify ObjectStoreLocationProvider

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on pull request #2963:
URL: https://github.com/apache/iceberg/pull/2963#issuecomment-897968033


   @cobookman the PR referenced is merged, could you update the documentation with the correct path resolution strategy? Thank you!


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] cobookman commented on pull request #2963: Docs: Clarify ObjectStoreLocationProvider

Posted by GitBox <gi...@apache.org>.
cobookman commented on pull request #2963:
URL: https://github.com/apache/iceberg/pull/2963#issuecomment-898222690


   /faceplam yep that was it, wasn't using the lastest on github. Got it to work, and will update the docs.
   
   ```sql
   CREATE TABLE my_catalog.my-db.my_table (
        id bigint,
        data string,
        category string)
   USING iceberg
   OPTIONS (
        'write.object-storage.enabled'=true,
         'write.folder-storage.path'='s3://my-bucket/some-random-folder/')
   PARTITIONED BY (category);
   ```
   
   Writes to: 
   ```
   s3://my-bucket/some-random-folder/21e81572/my-db.db/my_table/category=some+category/00000-0-5413ff19-edbc-41f9-ad2a-8ac1551ef3e1-00001.parquet`
   
   
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org