From 882c8104c803e9d2d13e3ed20307c4253c3f5850 Mon Sep 17 00:00:00 2001 From: Dawid Heyman Date: Thu, 28 Mar 2024 14:42:52 +0100 Subject: [PATCH] reformat --- .../snowflake/client/core/ArrowSqlInput.java | 5 +---- .../client/core/SFArrowResultSet.java | 18 ++++++++---------- .../snowflake/client/core/SFBaseResultSet.java | 13 ++++++------- .../snowflake/client/core/SFJsonResultSet.java | 6 ++++-- .../client/jdbc/SnowflakeBaseResultSet.java | 18 +++++++++++------- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/main/java/net/snowflake/client/core/ArrowSqlInput.java b/src/main/java/net/snowflake/client/core/ArrowSqlInput.java index f73a6a0ec..2ea95de0b 100644 --- a/src/main/java/net/snowflake/client/core/ArrowSqlInput.java +++ b/src/main/java/net/snowflake/client/core/ArrowSqlInput.java @@ -214,10 +214,7 @@ public T readObject(Class type) throws SQLException { SQLData instance = (SQLData) SQLDataCreationHelper.create(type); instance.readSQL( new ArrowSqlInput( - (Map) value, - session, - converters, - fieldMetadata.getFields()), + (Map) value, session, converters, fieldMetadata.getFields()), null); return (T) instance; }); diff --git a/src/main/java/net/snowflake/client/core/SFArrowResultSet.java b/src/main/java/net/snowflake/client/core/SFArrowResultSet.java index 355881144..58aa3a709 100644 --- a/src/main/java/net/snowflake/client/core/SFArrowResultSet.java +++ b/src/main/java/net/snowflake/client/core/SFArrowResultSet.java @@ -365,23 +365,21 @@ public Converters getConverters() { @Override public Date convertToDate(Object object, TimeZone tz) throws SFException { - return converters - .getStructuredTypeDateTimeConverter() - .getDate((int) object, tz); + return converters.getStructuredTypeDateTimeConverter().getDate((int) object, tz); } @Override public Time convertToTime(Object object, int scale) throws SFException { - return converters.getStructuredTypeDateTimeConverter() - .getTime((long) object, scale); + return converters.getStructuredTypeDateTimeConverter().getTime((long) object, scale); } @Override - public Timestamp convertToTimestamp(Object object, int columnType, int columnSubType, TimeZone tz, int scale) throws SFException { - return converters - .getStructuredTypeDateTimeConverter() - .getTimestamp( - (JsonStringHashMap) object, columnType, columnSubType, tz, scale); + public Timestamp convertToTimestamp( + Object object, int columnType, int columnSubType, TimeZone tz, int scale) throws SFException { + return converters + .getStructuredTypeDateTimeConverter() + .getTimestamp( + (JsonStringHashMap) object, columnType, columnSubType, tz, scale); } /** diff --git a/src/main/java/net/snowflake/client/core/SFBaseResultSet.java b/src/main/java/net/snowflake/client/core/SFBaseResultSet.java index a5026442c..a68bf82b6 100644 --- a/src/main/java/net/snowflake/client/core/SFBaseResultSet.java +++ b/src/main/java/net/snowflake/client/core/SFBaseResultSet.java @@ -191,15 +191,15 @@ public boolean isArrayBindSupported() { * data size. * * @param maxSizeInBytes The expected max data size wrapped in the ResultSetSerializables object. - * NOTE: this parameter is intended to make the data size in each serializable object to be - * less than it. But if user specifies a small value which may be smaller than the data size - * of one result chunk. So the definition can't be guaranteed completely. For this special - * case, one serializable object is used to wrap the data chunk. + * NOTE: this parameter is intended to make the data size in each serializable object to be + * less than it. But if user specifies a small value which may be smaller than the data size + * of one result chunk. So the definition can't be guaranteed completely. For this special + * case, one serializable object is used to wrap the data chunk. * @return a list of SnowflakeResultSetSerializable * @throws SQLException if fails to split objects. */ public List getResultSetSerializables(long maxSizeInBytes) - throws SQLException { + throws SQLException { return this.resultSetSerializable.splitBySize(maxSizeInBytes); } @@ -222,6 +222,5 @@ public TimeZone getSessionTimeZone() { @SnowflakeJdbcInternalApi public abstract Timestamp convertToTimestamp( - Object object, int columnType, int columnSubType, TimeZone tz, int scale) throws SFException; + Object object, int columnType, int columnSubType, TimeZone tz, int scale) throws SFException; } - diff --git a/src/main/java/net/snowflake/client/core/SFJsonResultSet.java b/src/main/java/net/snowflake/client/core/SFJsonResultSet.java index 600cfe0b8..5a91b7591 100644 --- a/src/main/java/net/snowflake/client/core/SFJsonResultSet.java +++ b/src/main/java/net/snowflake/client/core/SFJsonResultSet.java @@ -438,8 +438,10 @@ public Time convertToTime(Object object, int scale) throws SFException { } @Override - public Timestamp convertToTimestamp(Object object, int columnType, int columnSubType, TimeZone tz, int scale) throws SFException { - return (Timestamp) converters + public Timestamp convertToTimestamp( + Object object, int columnType, int columnSubType, TimeZone tz, int scale) throws SFException { + return (Timestamp) + converters .timestampConverter(columnSubType, columnType, scale, session, null, tz) .convert((String) object); } diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeBaseResultSet.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeBaseResultSet.java index 11952877d..c1c3e5154 100644 --- a/src/main/java/net/snowflake/client/jdbc/SnowflakeBaseResultSet.java +++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeBaseResultSet.java @@ -41,15 +41,12 @@ import net.snowflake.client.core.ColumnTypeHelper; import net.snowflake.client.core.JsonSqlInput; import net.snowflake.client.core.ObjectMapperFactory; -import net.snowflake.client.core.SFArrowResultSet; import net.snowflake.client.core.SFBaseResultSet; import net.snowflake.client.core.SFBaseSession; -import net.snowflake.client.core.SFException; import net.snowflake.client.core.structs.SQLDataCreationHelper; import net.snowflake.client.log.SFLogger; import net.snowflake.client.log.SFLoggerFactory; import net.snowflake.common.core.SqlState; -import org.apache.arrow.vector.util.JsonStringHashMap; /** Base class for query result set and metadata result set */ public abstract class SnowflakeBaseResultSet implements ResultSet { @@ -1589,7 +1586,10 @@ public Map getMap(int columnIndex, Class type) throws SQLExcep .get(columnIndex - 1) .getFields()); } else { - throw new SQLException("SqlInput type " + object.getClass() + " is not supported when mapping to SQLData class"); + throw new SQLException( + "SqlInput type " + + object.getClass() + + " is not supported when mapping to SQLData class"); } instance.readSQL(sqlInput, null); resultMap.put(entry.getKey(), (T) instance); @@ -1691,17 +1691,21 @@ public Map getMap(int columnIndex, Class type) throws SQLExcep } else if (Date.class.isAssignableFrom(type)) { resultMap.put( entry.getKey(), - mapSFExceptionToSQLException(() -> (T) sfBaseResultSet.convertToDate(entry.getValue(), tz))); + mapSFExceptionToSQLException( + () -> (T) sfBaseResultSet.convertToDate(entry.getValue(), tz))); } else if (Time.class.isAssignableFrom(type)) { resultMap.put( entry.getKey(), - mapSFExceptionToSQLException(() -> (T) sfBaseResultSet.convertToTime(entry.getValue(), scale))); + mapSFExceptionToSQLException( + () -> (T) sfBaseResultSet.convertToTime(entry.getValue(), scale))); } else if (Timestamp.class.isAssignableFrom(type)) { resultMap.put( entry.getKey(), mapSFExceptionToSQLException( - () -> (T) sfBaseResultSet.convertToTimestamp( + () -> + (T) + sfBaseResultSet.convertToTimestamp( entry.getValue(), columnType, columnSubType, tz, scale))); } else {