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) |
static void |
checkErrorAndThrowExceptionIncludingReauth(com.fasterxml.jackson.databind.JsonNode rootNode) |
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,
boolean jdbcTreatDecimalAsInt) |
static Throwable |
getRootCause(Exception ex) |
static String |
greatestCommonPrefix(String val1,
String val2) |
static boolean |
isBlank(String input) |
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.
|
static String |
randomAlphaNumeric(int count) |
public static final int EXTRA_TYPES_TIMESTAMP_LTZ
public static final int EXTRA_TYPES_TIMESTAMP_TZ
public static void checkErrorAndThrowExceptionIncludingReauth(com.fasterxml.jackson.databind.JsonNode rootNode)
throws SnowflakeSQLException
SnowflakeSQLExceptionpublic static void checkErrorAndThrowException(com.fasterxml.jackson.databind.JsonNode rootNode)
throws SnowflakeSQLException
SnowflakeSQLExceptionpublic static SnowflakeColumnMetadata extractColumnMetadata(com.fasterxml.jackson.databind.JsonNode colNode, boolean jdbcTreatDecimalAsInt) 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 concurrencypublic static boolean isBlank(String input)
public static String randomAlphaNumeric(int count)
Copyright © 2018. All rights reserved.