You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "davidrobbo (via GitHub)" <gi...@apache.org> on 2025/03/03 13:04:05 UTC

[I] Spark readStream not progresing [iceberg]

davidrobbo opened a new issue, #12444:
URL: https://github.com/apache/iceberg/issues/12444

   ### Apache Iceberg version
   
   1.6.1
   
   ### Query engine
   
   Spark
   
   ### Please describe the bug 🐞
   
   I'm trying to use Spark's readStream functionality to incrementally read changes to an Iceberg table on EMR serverless integrated with the AWS Glue Catalog, and S3 also used for checkpointing.
   
   ```
   spark.readStream
         .format("iceberg")
         .load(f"${sourceDatabase}.${sourceTable}")
   ```
   
   The initial query sets the offset for to the 79th of the entire 130 snapshot versions, and all subsequent runs do not progress.
   
   I've confirmed the base table I read from only has append snapshots, not deletes or updates.
   
   It appears as though the query is stuck. I have tried setting a variety of different options for similar bugs - more so just to hope they somehow assist with the problem as opposed to expecting that they are needed. This includes setting `"stream-from-timestamp"` to a value prior to the first snapshot, and also using:
   
   ```
   .option("streaming-skip-overwrite-snapshots", "true")
   .option("streaming-skip-delete-snapshots", "true")
   ```
   
   None of which change the behaviour (nor do I expect they should have any effect given the append only base table without snapshot expiration)
   
   ### Willingness to contribute
   
   - [ ] I can contribute a fix for this bug independently
   - [ ] I would be willing to contribute a fix for this bug with guidance from the Iceberg community
   - [ ] I cannot contribute a fix for this bug at this time


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


Re: [I] Spark readStream not progresing [iceberg]

Posted by "davidrobbo (via GitHub)" <gi...@apache.org>.
davidrobbo commented on issue #12444:
URL: https://github.com/apache/iceberg/issues/12444#issuecomment-2841895430

   After a big more digging, it appears this behaviour is tied to use of Trigger.AvailableNow. Switching to (the deprecated) Trigger.Once gets the stream moving again.


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


Re: [I] Spark readStream not progresing [iceberg]

Posted by "davidrobbo (via GitHub)" <gi...@apache.org>.
davidrobbo commented on issue #12444:
URL: https://github.com/apache/iceberg/issues/12444#issuecomment-2838964017

   @singhpk234 perhaps you have some understanding of a related issue.
   
   From digging into the source code, it also appears that readStream from a Iceberg table (at least with my setup as above) can not progress above processing Integer.MAX_VALUE in total across > 1 micro batches.
   
   It appears the first snapshot ID observed by the streaming query is written to `sources/0/offsets/0` (i.e.), and then during stream initialisation, the following check prevents file count or row count exceeding that which is configured:
   
   https://github.com/apache/iceberg/blob/e1ab42591488f25471a850547da9952aa9de48c2/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/source/SparkMicroBatchStream.java#L375
   
   And it's only later during planning the next micro batch where offsets (i.e. the last processed snapshot ID) is used to identify non-processed files/rows in incremental processing.
   
   https://github.com/apache/iceberg/blob/e1ab42591488f25471a850547da9952aa9de48c2/core/src/main/java/org/apache/iceberg/IncrementalDataTableScan.java#L64)
   
   Do you happen to have any insight on this?
   


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


Re: [I] Spark readStream not progresing [iceberg]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #12444: Spark readStream not progresing
URL: https://github.com/apache/iceberg/issues/12444


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


Re: [I] Spark readStream not progresing [iceberg]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #12444:
URL: https://github.com/apache/iceberg/issues/12444#issuecomment-3453900107

   This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.


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


Re: [I] Spark readStream not progresing [iceberg]

Posted by "davidrobbo (via GitHub)" <gi...@apache.org>.
davidrobbo commented on issue #12444:
URL: https://github.com/apache/iceberg/issues/12444#issuecomment-2694460203

   After a bit more investigation, I'm wondering if https://github.com/apache/iceberg/issues/8902 is relevant.
   
   The 79th snapshot does contain in the region of Integer.MAX_VALUE records. Attempting to set the following now fails understandably as the configured value exceeds Integer.MAX_VALUE:
   
   ```
   .option("streaming-max-files-per-micro-batch", 10000)
   .option("streaming-max-rows-per-micro-batch", 10000000000L)
   ```
   
   Curious as to whether there is a snag that prevents me attempting to backfill using readStream+trigger.AvailableNow if record count >= Integer.MAX_VALUE and whether an initial batch load should be the path forward currently.


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


Re: [I] Spark readStream not progresing [iceberg]

Posted by "singhpk234 (via GitHub)" <gi...@apache.org>.
singhpk234 commented on issue #12444:
URL: https://github.com/apache/iceberg/issues/12444#issuecomment-2697843431

   @davidrobbo  yes it is let me put a pr to make it long, presently there is a limitation here : 
   - https://github.com/apache/iceberg/pull/12217#discussion_r1962211721


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


Re: [I] Spark readStream not progresing [iceberg]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #12444:
URL: https://github.com/apache/iceberg/issues/12444#issuecomment-3514445901

   This issue has been closed because it has not received any activity in the last 14 days since being marked as 'stale'


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