[
https://issues.apache.org/jira/browse/PHOENIX-7332?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Viraj Jasani updated PHOENIX-7332:
----------------------------------
Fix Version/s: 5.4.0
(was: 5.3.0)
> Upsert Select with Array Projections with Autocommit set to true fails
> ----------------------------------------------------------------------
>
> Key: PHOENIX-7332
> URL: https://issues.apache.org/jira/browse/PHOENIX-7332
> Project: Phoenix
> Issue Type: Bug
> Reporter: Ranganath Govardhanagiri
> Priority: Major
> Fix For: 5.4.0
>
>
> {code:java}
> @Test
> public void testServerArrayElementProjectionFailure() throws SQLException {
> Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
> Connection conn = DriverManager.getConnection(getUrl(), props);
> conn.setAutoCommit(true);
> String table = generateUniqueName();
> String ddl = "CREATE TABLE " + table + " (p INTEGER PRIMARY KEY, col1
> INTEGER, arr1 INTEGER ARRAY, arr2 VARCHAR ARRAY)";
> conn.createStatement().execute(ddl);
> conn.close();
> conn = DriverManager.getConnection(getUrl(), props);
> PreparedStatement stmt = conn.prepareStatement("UPSERT INTO " + table + "
> VALUES (1,0, ARRAY[1, 2], ARRAY['a', 'b'])");
> stmt.execute();
> conn.commit();
> conn.close();
> conn = DriverManager.getConnection(getUrl(), props);
> conn.setAutoCommit(true);
> ResultSet rs;
> stmt = conn.prepareStatement("UPSERT INTO " + table + "(p,col1) SELECT p,
> arr1[1] FROM " + table);
> stmt.execute();
> }{code}
> Executing the above IT will fail with the below error.
> {code:java}
> java.lang.IllegalArgumentException: No ExpressionType for class
> org.apache.phoenix.compile.ProjectionCompiler$ArrayIndexExpression
> at
> org.apache.phoenix.expression.ExpressionType.valueOf(ExpressionType.java:226)
> at
> org.apache.phoenix.coprocessorclient.UngroupedAggregateRegionObserverHelper.serialize(UngroupedAggregateRegionObserverHelper.java:45)
> at
> org.apache.phoenix.compile.UpsertCompiler.compile(UpsertCompiler.java:805)
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)