Skip to content

[SNOW-3249917] JDBC removal Step 8b: Replicate SnowflakeFileTransferMetadataV1, ObjectMapperFactory, expand SqlState#1121

Open
sfc-gh-ggeng wants to merge 2 commits intomasterfrom
jdbc-removal-step8b-metadata-v1
Open

[SNOW-3249917] JDBC removal Step 8b: Replicate SnowflakeFileTransferMetadataV1, ObjectMapperFactory, expand SqlState#1121
sfc-gh-ggeng wants to merge 2 commits intomasterfrom
jdbc-removal-step8b-metadata-v1

Conversation

@sfc-gh-ggeng
Copy link
Copy Markdown
Contributor

Summary

Verbatim replication of three more classes from JDBC:

  • SnowflakeFileTransferMetadataV1 (109 lines) — file transfer metadata, depends on StageInfo/RemoteStoreFileEncryptionMaterial/CommandType (all replicated in prior steps)
  • SnowflakeFileTransferMetadata (interface) — return type for getFileTransferMetadatas
  • ObjectMapperFactory (38 lines) — singleton ObjectMapper factory with configurable max string length. SystemUtil.convertSystemPropertyToIntValue inlined.

Also expanded SqlState with all constants needed by ErrorCode (previously only had SYSTEM_ERROR and INTERNAL_ERROR).

Import swaps deferred — all types tightly coupled across InternalStage's JDBC upload path. Will be swapped together in Step 8c.

Stacked on #1120.

Replication Verification Diff Report

SnowflakeFileTransferMetadataV1

JDBC source : net/snowflake/client/jdbc/SnowflakeFileTransferMetadataV1.java @ v3.25.1
Ingest copy : src/main/java/net/snowflake/ingest/streaming/internal/fileTransferAgent/SnowflakeFileTransferMetadataV1.java

Permitted differences (mechanical):

  • Package declaration changed
  • SnowflakeUtil.isNullOrEmptyStorageClientUtil.isNullOrEmpty
  • StageInfo, RemoteStoreFileEncryptionMaterial, CommandType → ingest versions (same package)

Unexpected differences: NONE

SnowflakeFileTransferMetadata

JDBC source : net/snowflake/client/jdbc/SnowflakeFileTransferMetadata.java @ v3.25.1
Ingest copy : src/main/java/net/snowflake/ingest/streaming/internal/fileTransferAgent/SnowflakeFileTransferMetadata.java

Unexpected differences: NONE

ObjectMapperFactory

JDBC source : net/snowflake/client/core/ObjectMapperFactory.java @ v3.25.1
Ingest copy : src/main/java/net/snowflake/ingest/streaming/internal/fileTransferAgent/ObjectMapperFactory.java

Permitted differences (mechanical):

  • Package declaration changed
  • @SnowflakeJdbcInternalApi annotations removed
  • SystemUtil.convertSystemPropertyToIntValue inlined (avoids replicating SystemUtil)

Unexpected differences:

  • convertSystemPropertyToIntValue inlined as private method — safe, identical logic

SqlState (expanded)

JDBC source : net/snowflake/client/jdbc/internal/snowflake/common/core/SqlState.java (from snowflake-common)
Ingest copy : src/main/java/net/snowflake/ingest/streaming/internal/fileTransferAgent/SqlState.java

Added 15 constants needed by ErrorCode. Values are standard ANSI SQL state codes.

Test plan

  • mvn compiler:compile passes
  • ./format.sh passes
  • Full test suite

🤖 Generated with Claude Code

@sfc-gh-ggeng sfc-gh-ggeng force-pushed the jdbc-removal-step8b-metadata-v1 branch from dafed99 to da481d4 Compare March 27, 2026 21:42
@sfc-gh-ggeng sfc-gh-ggeng force-pushed the jdbc-removal-step8a-stage-info branch from 9cdb0d1 to 5cde2f9 Compare March 27, 2026 21:43
…FileEncryptionMaterial

Verbatim replication of two data classes from JDBC:
- StageInfo (229 lines) — stage descriptor with StageType enum, credentials,
  region, endpoint, presigned URL. @SnowflakeJdbcInternalApi removed.
- RemoteStoreFileEncryptionMaterial (46 lines) — encryption key holder.
  From snowflake-common (decompiled, no public source).

Import swaps deferred — StageInfo is tightly coupled with
SnowflakeFileTransferMetadataV1 (metadata.getStageInfo() returns JDBC's
StageInfo). Both must be swapped together in Step 8b.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sfc-gh-ggeng sfc-gh-ggeng force-pushed the jdbc-removal-step8a-stage-info branch from 5cde2f9 to 19baea1 Compare March 28, 2026 20:40
…etadataV1, ObjectMapperFactory, expand SqlState

Verbatim replication of three more classes from JDBC:
- SnowflakeFileTransferMetadataV1 (109 lines) — file transfer metadata,
  depends on StageInfo/RemoteStoreFileEncryptionMaterial/CommandType (all
  replicated in previous steps)
- SnowflakeFileTransferMetadata (interface) — return type for
  getFileTransferMetadatas
- ObjectMapperFactory (38 lines) — singleton ObjectMapper factory with
  configurable max string length. SystemUtil.convertSystemPropertyToIntValue
  inlined.

Also expanded SqlState with all constants needed by ErrorCode (previously
only had SYSTEM_ERROR and INTERNAL_ERROR).

Import swaps deferred — StageInfo/SnowflakeFileTransferMetadataV1/
RemoteStoreFileEncryptionMaterial are tightly coupled across InternalStage
(which still needs JDBC types for the uploadWithoutConnection path).
All types will be swapped together when the upload path is replaced.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sfc-gh-ggeng sfc-gh-ggeng force-pushed the jdbc-removal-step8b-metadata-v1 branch from da481d4 to 6ed462b Compare March 28, 2026 20:47
Base automatically changed from jdbc-removal-step8a-stage-info to master March 28, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants