apache/beam · error · UnsupportedOperationException
Not supported by SnowflakeIO.
Error message
Not supported by SnowflakeIO.
What it means
SnowflakeStreamingServiceImpl.read is intentionally unimplemented: SnowflakeIO supports streaming writes (via Snowpipe) but not streaming reads. Any call to read() on the streaming service throws UnsupportedOperationException.
Solutions
- Use SnowflakeIO's batch read path (SnowflakeIO.Read with SnowflakeBatchServiceConfig / StatementExecutionSupplier) instead of streaming.
- Do not instantiate SnowflakeStreamingServiceImpl for reads; inject SnowflakeBatchServiceImpl.
- If you need near-real-time ingestion out of Snowflake, use a stream/Snowflake connector outside Beam and feed the records into your pipeline.
Example fix
// before SnowflakeIO.<KV<String,String>>read().withSnowflakeService(new SnowflakeStreamingServiceImpl<>()) // after SnowflakeIO.<KV<String,String>>read().withSnowflakeService(new SnowflakeBatchServiceImpl<>()) .withStatementExecutionSupplier(...) .withOutputTranslation(...)
Defensive patterns
Strategy: validation
Validate before calling
// Guard before wiring the service // if (isReadPipeline) useBatchService(); // SnowflakeStreamingServiceImpl only supports write/ingest
Type guard
// Java
def SnowflakeService<?> requireBatchService(SnowflakeService<?> svc) {
if (svc instanceof SnowflakeStreamingServiceImpl) throw new IllegalArgumentException("streaming service does not support read");
return svc;
} Try / catch
// not catchable in a useful way — UnsupportedOperationException marks a programming error
catch (UnsupportedOperationException e) { /* switch to batch read path; do not retry */ } Prevention
- Remember: SnowflakeIO streaming = write only; reads always use the batch service.
- Centralize Snowflake service construction in one factory to avoid mixing implementations.
- Review SnowflakeIO docs for the read API before building read pipelines.
When it happens
Trigger: Calling SnowflakeIO.read (or the read method of a SnowflakeStreamingService instance) with a SnowflakeStreamingServiceConfig — i.e., attempting to use the streaming service implementation for a read path.
Common situations: Confusing the streaming (write-only) service with the batch service; wiring the wrong SnowflakeService implementation into a read transform; copy-pasting a streaming config into a read pipeline.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- flushRowLimit must be greater than 0.
- flushTimeLimitMillis must be greater than 0.
- Runner does not support draining.
- side of an OUTER JOIN must be Unbounded table.
- shardsNumber must be greater than 0.
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/329d6f6be59daa1d.
Report an issue: GitHub.
Appendix: source
Thrown at sdks/java/io/snowflake/src/main/java/org/apache/beam/sdk/io/snowflake/services/SnowflakeStreamingServiceImpl.java:45
/** Implementation of {@link SnowflakeServices.StreamingService} used in production. */
@SuppressWarnings({
"nullness" // TODO(https://github.com/apache/beam/issues/20497)
})
public class SnowflakeStreamingServiceImpl implements SnowflakeServices.StreamingService {
private transient SimpleIngestManager ingestManager;
/** Writing data to Snowflake in streaming mode. */
@Override
public void write(SnowflakeStreamingServiceConfig config) throws Exception {
ingest(config);
}
/** Reading data from Snowflake in streaming mode is not supported. */
@Override
public String read(SnowflakeStreamingServiceConfig config) throws Exception {
throw new UnsupportedOperationException("Not supported by SnowflakeIO.");
}
/**
* SnowPipe is processing files from stage in streaming mode.
*
* @param config configuration object containing parameters for writing files to Snowflake
* @throws IngestResponseException REST API response error
* @throws IOException Snowflake problem while streaming
* @throws URISyntaxException creating request error
*/
private void ingest(SnowflakeStreamingServiceConfig config)
throws IngestResponseException, IOException, URISyntaxException {
List<String> filesList = config.getFilesList();
String stagingBucketDir = config.getStagingBucketDir();
ingestManager = config.getIngestManager();
Set<String> files =
filesList.stream()View on GitHub (pinned to 12126d8942)