{"record":{"id":"329d6f6be59daa1d","repo":"apache/beam","slug":"not-supported-by-snowflakeio","errorCode":null,"errorMessage":"Not supported by SnowflakeIO.","messagePattern":"Not supported by SnowflakeIO\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/snowflake/src/main/java/org/apache/beam/sdk/io/snowflake/services/SnowflakeStreamingServiceImpl.java","lineNumber":45,"sourceCode":"\n/** Implementation of {@link SnowflakeServices.StreamingService} used in production. */\n@SuppressWarnings({\n  \"nullness\" // TODO(https://github.com/apache/beam/issues/20497)\n})\npublic class SnowflakeStreamingServiceImpl implements SnowflakeServices.StreamingService {\n\n  private transient SimpleIngestManager ingestManager;\n\n  /** Writing data to Snowflake in streaming mode. */\n  @Override\n  public void write(SnowflakeStreamingServiceConfig config) throws Exception {\n    ingest(config);\n  }\n\n  /** Reading data from Snowflake in streaming mode is not supported. */\n  @Override\n  public String read(SnowflakeStreamingServiceConfig config) throws Exception {\n    throw new UnsupportedOperationException(\"Not supported by SnowflakeIO.\");\n  }\n\n  /**\n   * SnowPipe is processing files from stage in streaming mode.\n   *\n   * @param config configuration object containing parameters for writing files to Snowflake\n   * @throws IngestResponseException REST API response error\n   * @throws IOException Snowflake problem while streaming\n   * @throws URISyntaxException creating request error\n   */\n  private void ingest(SnowflakeStreamingServiceConfig config)\n      throws IngestResponseException, IOException, URISyntaxException {\n    List<String> filesList = config.getFilesList();\n    String stagingBucketDir = config.getStagingBucketDir();\n    ingestManager = config.getIngestManager();\n\n    Set<String> files =\n        filesList.stream()","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/snowflake/src/main/java/org/apache/beam/sdk/io/snowflake/services/SnowflakeStreamingServiceImpl.java#L27-L63","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nSnowflakeIO.<KV<String,String>>read().withSnowflakeService(new SnowflakeStreamingServiceImpl<>())\n// after\nSnowflakeIO.<KV<String,String>>read().withSnowflakeService(new SnowflakeBatchServiceImpl<>())\n  .withStatementExecutionSupplier(...) .withOutputTranslation(...)","handlingStrategy":"validation","validationCode":"// Guard before wiring the service\n// if (isReadPipeline) useBatchService(); // SnowflakeStreamingServiceImpl only supports write/ingest","typeGuard":"// Java\ndef SnowflakeService<?> requireBatchService(SnowflakeService<?> svc) {\n  if (svc instanceof SnowflakeStreamingServiceImpl) throw new IllegalArgumentException(\"streaming service does not support read\");\n  return svc;\n}","tryCatchPattern":"// not catchable in a useful way — UnsupportedOperationException marks a programming error\ncatch (UnsupportedOperationException e) { /* switch to batch read path; do not retry */ }","preventionTips":["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."],"tags":["snowflake","unsupported-operation","streaming","api-misuse"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}