Skip to content

[SNOW-3249917] JDBC removal Step 7b: Replicate getFileTransferMetadatas#1119

Merged
sfc-gh-ggeng merged 6 commits intomasterfrom
jdbc-removal-step7b-replace-file-transfer-agent
Mar 27, 2026
Merged

[SNOW-3249917] JDBC removal Step 7b: Replicate getFileTransferMetadatas#1119
sfc-gh-ggeng merged 6 commits intomasterfrom
jdbc-removal-step7b-replace-file-transfer-agent

Conversation

@sfc-gh-ggeng
Copy link
Copy Markdown
Contributor

@sfc-gh-ggeng sfc-gh-ggeng commented Mar 24, 2026

Summary

Verbatim replication of static parsing methods from JDBC's SnowflakeFileTransferAgent into IngestFileTransferAgent:

  • getFileTransferMetadatas (1-arg and 2-arg overloads)
  • getStageInfo, extractStageCreds, getEncryptionMaterial
  • expandFileNames, setupUseRegionalUrl, setupUseVirtualUrl
  • CommandType enum (extracted from SFBaseFileTransferAgent)

Note: The import swap in InternalStage is deferred — swapping now would require declaring both JDBC's and ingest's SnowflakeSQLException in throws clauses. The swap happens in Step 8 when all JDBC types in InternalStage are replaced together.

Updated plan: split old Step 7b into 7b (parsing replication) and 7c (upload migration).

Stacked on #1116.

Replication Verification Diff Report

IngestFileTransferAgent

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

Permitted differences (mechanical):

  • Package declaration changed
  • SFLogger/SFLoggerFactory → ingest's replicated versions
  • SnowflakeUtil.isNullOrEmptyStorageClientUtil.isNullOrEmpty
  • SnowflakeUtil.systemGetPropertyStorageClientUtil.systemGetProperty
  • ErrorCode → ingest's ErrorCode
  • SnowflakeSQLException → ingest's SnowflakeSQLException
  • SFBaseFileTransferAgent.CommandType → top-level CommandType enum

Unexpected differences:

  • Return type uses net.snowflake.client.jdbc.SnowflakeFileTransferMetadata (JDBC interface) temporarily — will use ingest version in Step 8
  • CommandTypeSFBaseFileTransferAgent.CommandType bridge in constructor call — temporary until SnowflakeFileTransferMetadataV1 is replicated in Step 8

CommandType

JDBC source : net/snowflake/client/jdbc/SFBaseFileTransferAgent.java @ v3.25.1 (inner enum)
Ingest copy : src/main/java/net/snowflake/ingest/streaming/internal/fileTransferAgent/CommandType.java

Permitted differences (mechanical):

  • Extracted from inner enum to top-level class

Unexpected differences: NONE

Test plan

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

🤖 Generated with Claude Code

@sfc-gh-ggeng sfc-gh-ggeng requested review from a team as code owners March 24, 2026 19:13
@sfc-gh-ggeng sfc-gh-ggeng force-pushed the jdbc-removal-step7b-replace-file-transfer-agent branch from b7886dc to 927131e Compare March 24, 2026 19:59
@sfc-gh-ggeng sfc-gh-ggeng force-pushed the jdbc-removal-step7a-inline-error-helpers branch from bc6c23a to 27d1ee5 Compare March 24, 2026 19:59
Base automatically changed from jdbc-removal-step7a-inline-error-helpers to master March 24, 2026 22:39
@sfc-gh-ggeng sfc-gh-ggeng force-pushed the jdbc-removal-step7b-replace-file-transfer-agent branch from dafed99 to eed1c75 Compare March 24, 2026 22:49
sfc-gh-ggeng and others added 6 commits March 27, 2026 21:41
…oad)

Step 7b: Replicate getFileTransferMetadatas and helper methods verbatim
Step 7c: Route uploadWithoutConnection through IcebergFileTransferAgent
  (which is the existing replication of JDBC's upload stack)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Verbatim replication of static parsing methods from JDBC's
SnowflakeFileTransferAgent into IngestFileTransferAgent:
- getFileTransferMetadatas (1-arg and 2-arg)
- getStageInfo, extractStageCreds, getEncryptionMaterial
- expandFileNames, setupUseRegionalUrl, setupUseVirtualUrl
- CommandType enum (extracted from SFBaseFileTransferAgent)

Swap getFileTransferMetadatas calls in InternalStage to use
IngestFileTransferAgent. JDBC's SnowflakeFileTransferAgent import
remains (uploadWithoutConnection still uses JDBC — deferred to Step 7c).

Temporary: throws clauses on InternalStage methods declare both JDBC's
and ingest's SnowflakeSQLException during transition. Will be cleaned
up in Step 8 when SnowflakeFileTransferMetadataV1 is replicated.

Updated plan: split old Step 7b into 7b (parsing) and 7c (upload).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Verbatim replication of static parsing methods from JDBC's
SnowflakeFileTransferAgent into IngestFileTransferAgent:
- getFileTransferMetadatas (1-arg and 2-arg)
- getStageInfo, extractStageCreds, getEncryptionMaterial
- expandFileNames, setupUseRegionalUrl, setupUseVirtualUrl
- CommandType enum (extracted from SFBaseFileTransferAgent)

The import swap in InternalStage is deferred — swapping now would
require declaring both JDBC's and ingest's SnowflakeSQLException in
throws clauses. The swap happens in Step 8 when all JDBC types in
InternalStage are replaced together.

Updated plan: split old Step 7b into 7b (parsing) and 7c (upload).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- IngestFileTransferAgent → SnowflakeFileTransferAgent (same name as JDBC)
- CommandType: moved from top-level class to inner enum (matches JDBC's
  SFBaseFileTransferAgent.CommandType structure)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add SFBaseFileTransferAgent with CommandType enum (matching JDBC structure)
- SnowflakeFileTransferAgent now extends SFBaseFileTransferAgent (matching JDBC)
- Remove duplicate CommandType inner enum from SnowflakeFileTransferAgent
- SFBaseFileTransferAgent omits FixedView infrastructure (not used by
  replicated methods, depends on JDBC-internal types)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Break down remaining work based on actual JDBC import inventory:
- Step 8a: Replicate StageInfo, RemoteStoreFileEncryptionMaterial
- Step 8b: Replicate SnowflakeFileTransferMetadataV1, ObjectMapperFactory;
           swap all InternalStage JDBC imports
- Step 8c: Route uploadWithoutConnection through IcebergFileTransferAgent
- Step 9a: Clean up replicated classes' JDBC imports (SqlState, SFSession,
           SFException, SecretDetector)
- Step 9b: Clean up SnowflakeSQLLoggedException telemetry (12 JDBC imports)
- Step 9c: Clean up TelemetryClient JDBC imports (6 imports)
- Step 10: Remove JDBC dependency

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sfc-gh-ggeng sfc-gh-ggeng force-pushed the jdbc-removal-step7b-replace-file-transfer-agent branch from eed1c75 to 9701b54 Compare March 27, 2026 21:42
@sfc-gh-ggeng sfc-gh-ggeng enabled auto-merge (squash) March 27, 2026 21:46
@sfc-gh-ggeng sfc-gh-ggeng merged commit 4f83d0f into master Mar 27, 2026
47 of 52 checks passed
@sfc-gh-ggeng sfc-gh-ggeng deleted the jdbc-removal-step7b-replace-file-transfer-agent branch March 27, 2026 22:54
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