Skip to content

Commit

Permalink
remove incorrect dependency, fix filename after resolving merge confl…
Browse files Browse the repository at this point in the history
…icts
  • Loading branch information
sfc-gh-mkubik committed Nov 27, 2024
1 parent 52b5c6e commit fedace4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,40 +224,39 @@ public void testReturnStructAsStringIfTypeWasNotIndicated(ResultSetFormatType fo
+ " \"intValue\": 2\n"
+ " }\n"
+ "}";
String expectedJsonFromArrow =
"{\"string\": \"a\",\"b\": 1,\"s\": 2,\"i\": 3,\"l\": 4,\"f\": 1.1,\"d\": 2.2,\"bd\": 3.3,"
+ "\"bool\": true,\"timestamp_ltz\": \"2021-12-22 09:43:44.000 +0100\",\"timestamp_ntz\": \"2021-12-23 09:44:44.000\","
+ "\"timestamp_tz\": \"2021-12-24 09:45:45.000 +0800\",\"date\": \"2023-12-24\",\"time\": \"12:34:56\",\"binary\": \"616263\","
+ "\"simpleClass\": {\"string\": \"b\",\"intValue\": 2}}";
if (format == ResultSetFormatType.NATIVE_ARROW) {
Assert.assertEquals(expectedJsonFromArrow, object);
} else {
Assert.assertEquals(expectedJson, object);
}
String expectedJsonFromArrow =
"{\"string\": \"a\",\"b\": 1,\"s\": 2,\"i\": 3,\"l\": 4,\"f\": 1.1,\"d\": 2.2,\"bd\": 3.3,"
+ "\"bool\": true,\"timestamp_ltz\": \"2021-12-22 09:43:44.000 +0100\",\"timestamp_ntz\": \"2021-12-23 09:44:44.000\","
+ "\"timestamp_tz\": \"2021-12-24 09:45:45.000 +0800\",\"date\": \"2023-12-24\",\"time\": \"12:34:56\",\"binary\": \"616263\","
+ "\"simpleClass\": {\"string\": \"b\",\"intValue\": 2}}";
if (format == ResultSetFormatType.NATIVE_ARROW) {
Assert.assertEquals(expectedJsonFromArrow, object);
} else {
Assert.assertEquals(expectedJson, object);
}
}
}
}


@ParameterizedTest
@ArgumentsSource(ResultFormatProvider.class)
@DontRunOnGithubActions
public void testThrowingGettingObjectIfTypeWasNotIndicatedAndFormatNativeArrow(
ResultSetFormatType format) throws SQLException {
Assumptions.assumeTrue(format == ResultSetFormatType.NATIVE_ARROW);
withFirstRow(
"select {'string':'a'}::OBJECT(string VARCHAR)",
(resultSet) -> {
assertThrows(SQLException.class, () -> resultSet.getObject(1));
},
format);
withFirstRow(
"select {'x':{'string':'one'},'y':{'string':'two'},'z':{'string':'three'}}::MAP(VARCHAR, OBJECT(string VARCHAR));",
(resultSet) -> {
assertThrows(SQLException.class, () -> resultSet.getObject(1, Map.class));
},
format);
}
@ParameterizedTest
@ArgumentsSource(ResultFormatProvider.class)
@DontRunOnGithubActions
public void testThrowingGettingObjectIfTypeWasNotIndicatedAndFormatNativeArrow(
ResultSetFormatType format) throws SQLException {
Assumptions.assumeTrue(format == ResultSetFormatType.NATIVE_ARROW);
withFirstRow(
"select {'string':'a'}::OBJECT(string VARCHAR)",
(resultSet) -> {
assertThrows(SQLException.class, () -> resultSet.getObject(1));
},
format);
withFirstRow(
"select {'x':{'string':'one'},'y':{'string':'two'},'z':{'string':'three'}}::MAP(VARCHAR, OBJECT(string VARCHAR));",
(resultSet) -> {
assertThrows(SQLException.class, () -> resultSet.getObject(1, Map.class));
},
format);
}

@ParameterizedTest
@ArgumentsSource(ResultFormatProvider.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import jdk.jpackage.internal.Arguments;
import net.snowflake.client.annotations.DontRunOnGithubActions;
import net.snowflake.client.category.TestTags;
import net.snowflake.client.jdbc.ResultSetFormatType;
Expand All @@ -23,8 +21,7 @@
import org.junit.jupiter.params.provider.ArgumentsSource;

@Tag(TestTags.RESULT_SET)
public class StructuredTypesGetStringArrowJsonCompatibilityIT
extends StructuredTypesGetStringBaseIT {
public class StructuredTypesArrowJsonCompatibilityLatestIT extends StructuredTypesGetStringBaseIT {
private static Map<ResultSetFormatType, Connection> connections = new HashMap<>();

@BeforeAll
Expand Down

0 comments on commit fedace4

Please sign in to comment.