Skip to content

Commit

Permalink
Update error code & message
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-alhuang committed Aug 20, 2024
1 parent ac7bfc1 commit 310476e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ public void addStorage(
new ExternalVolumeLocation(dbName, schemaName, tableName),
DEFAULT_MAX_UPLOAD_RETRIES));
} catch (SnowflakeSQLException | IOException err) {
throw new SFException(err, ErrorCode.UNABLE_TO_CONNECT_TO_STAGE);
throw new SFException(
err,
ErrorCode.UNABLE_TO_CONNECT_TO_STAGE,
String.format("fullyQualifiedTableName=%s", fullyQualifiedTableName));
}
}

Expand All @@ -142,11 +145,11 @@ public FileLocationInfo getRefreshedLocation(
ChannelConfigureResponse response = this.snowflakeServiceClient.channelConfigure(request);
return response.getStageLocation();
} catch (IngestResponseException | IOException e) {
throw new SFException(e, ErrorCode.CLIENT_CONFIGURE_FAILURE, e.getMessage());
throw new SFException(e, ErrorCode.CHANNEL_CONFIGURE_FAILURE, e.getMessage());
}
}

// TODO: SNOW-1502887 Blob path generation for iceberg table
// TODO: SNOW-1502887 Blob path generation for external volume
@Override
public String generateBlobPath() {
return "snow_dummy_file_name.parquet";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class OpenChannelResponse extends StreamingIngestResponse {
private List<ColumnMetadata> tableColumns;
private String encryptionKey;
private Long encryptionKeyId;
private FileLocationInfo icebergLocation;
private FileLocationInfo externalVolumeLocation;

@JsonProperty("status_code")
void setStatusCode(Long statusCode) {
Expand Down Expand Up @@ -133,11 +133,11 @@ Long getEncryptionKeyId() {
}

@JsonProperty("iceberg_location")
void setIcebergLocation(FileLocationInfo icebergLocation) {
this.icebergLocation = icebergLocation;
void setExternalVolumeLocation(FileLocationInfo externalVolumeLocation) {
this.externalVolumeLocation = externalVolumeLocation;
}

FileLocationInfo getIcebergLocation() {
return this.icebergLocation;
FileLocationInfo getExternalVolumeLocation() {
return this.externalVolumeLocation;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ public SnowflakeStreamingIngestChannelInternal<?> openChannel(OpenChannelRequest
response.getDBName(),
response.getSchemaName(),
response.getTableName(),
response.getIcebergLocation());
response.getExternalVolumeLocation());

return channel;
} catch (IOException | IngestResponseException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
0018=Invalid encrypted private key or passphrase, failed to decrypt private key.
0019=Invalid table data in chunk.
0020=Ingest client encountered IO error.
0021=Unable to connect to streaming ingest internal stage.
0021=Unable to connect to streaming ingest stage: {0}.
0022=Unable to create key pair from the provided private key.
0023=MD5 hashing algorithm is not available.
0024=Get channel status request failed: {0}.
Expand Down

0 comments on commit 310476e

Please sign in to comment.