Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 958475c

Browse files
committedOct 15, 2024·
Merge remote-tracking branch 'ritikRepo/feature/errorhandling-snowflake' into feature/error_handling_snowflake
2 parents 69c98fb + 0cf3225 commit 958475c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎athena-snowflake/src/main/java/com/amazonaws/athena/connectors/snowflake/SnowflakeMetadataHandler.java

+4
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
import com.google.common.base.Strings;
6565
import com.google.common.collect.ImmutableMap;
6666
import com.google.common.collect.ImmutableSet;
67+
import net.snowflake.client.jdbc.SnowflakeSQLException;
6768
import org.apache.arrow.vector.complex.reader.FieldReader;
6869
import org.apache.arrow.vector.types.Types;
6970
import org.apache.arrow.vector.types.pojo.ArrowType;
@@ -458,6 +459,9 @@ public Schema getSchema(Connection jdbcConnection, TableName tableName, Schema p
458459
}
459460
partitionSchema.getFields().forEach(schemaBuilder::addField);
460461
}
462+
catch (SnowflakeSQLException ex) {
463+
throw new AthenaConnectorException(ex.getMessage(), new ErrorDetails().withErrorCode(FederationSourceErrorCode.AccessDeniedException.toString()));
464+
}
461465
LOGGER.debug(schemaBuilder.toString());
462466
return schemaBuilder.build();
463467
}

0 commit comments

Comments
 (0)
Please sign in to comment.