public class SnowflakeUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
EXTRA_TYPES_TIMESTAMP_LTZ
Additional data types not covered by standard JDBC
|
static int |
EXTRA_TYPES_TIMESTAMP_TZ |
| Constructor and Description |
|---|
SnowflakeUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkErrorAndThrowException(com.fasterxml.jackson.databind.JsonNode rootNode)
Check the error in the JSON node and generate an exception based on
information extracted from the node.
|
static String |
concatFilePathNames(String leftPath,
String rightPath,
String fileSep)
A small function for concatenating two file paths by making sure one and
only one path separator is placed between the two paths.
|
static ThreadPoolExecutor |
createDefaultExecutorService(String threadNamePrefix,
int parallel)
Returns a new thread pool configured with the default settings.
|
static List<SnowflakeColumnMetadata> |
describeFixedViewColumns(Class clazz) |
static SnowflakeColumnMetadata |
extractColumnMetadata(com.fasterxml.jackson.databind.JsonNode colNode) |
static Throwable |
getRootCause(Exception ex) |
static String |
greatestCommonPrefix(String val1,
String val2) |
static SnowflakeType |
javaTypeToSFType(int javaType) |
static String |
javaTypeToSFTypeString(int javaType) |
static void |
logResponseDetails(org.apache.http.HttpResponse response,
SFLogger logger)
A utility to log response details.
|
public static final int EXTRA_TYPES_TIMESTAMP_LTZ
public static final int EXTRA_TYPES_TIMESTAMP_TZ
public static void checkErrorAndThrowException(com.fasterxml.jackson.databind.JsonNode rootNode)
throws SnowflakeSQLException
rootNode - json object contains error informationSnowflakeSQLException - the exception get from the error in the jsonpublic static SnowflakeColumnMetadata extractColumnMetadata(com.fasterxml.jackson.databind.JsonNode colNode) throws SnowflakeSQLException
SnowflakeSQLExceptionpublic static String javaTypeToSFTypeString(int javaType) throws SnowflakeSQLException
SnowflakeSQLExceptionpublic static SnowflakeType javaTypeToSFType(int javaType) throws SnowflakeSQLException
SnowflakeSQLExceptionpublic static String concatFilePathNames(String leftPath, String rightPath, String fileSep)
This is necessary since for S3 file name, having different number of file separators in a path will mean different files.
Typical use case is to concatenate a file name to a directory.
leftPath - left pathrightPath - right pathfileSep - file separatorpublic static List<SnowflakeColumnMetadata> describeFixedViewColumns(Class clazz) throws SnowflakeSQLException
SnowflakeSQLExceptionpublic static void logResponseDetails(org.apache.http.HttpResponse response,
SFLogger logger)
Used when there is an error in http response
response - http response get from serverlogger - logger objectpublic static ThreadPoolExecutor createDefaultExecutorService(String threadNamePrefix, int parallel)
threadNamePrefix - prefix of the thread nameparallel - the number of concurrencyCopyright © 2017. All rights reserved.