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

  1. Use SnowflakeIO's batch read path (SnowflakeIO.Read with SnowflakeBatchServiceConfig / StatementExecutionSupplier) instead of streaming.
  2. Do not instantiate SnowflakeStreamingServiceImpl for reads; inject SnowflakeBatchServiceImpl.
  3. 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

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


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)