gjacoby126 commented on code in PR #1437:
URL: https://github.com/apache/phoenix/pull/1437#discussion_r870740147


##########
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionlessQueryServicesImpl.java:
##########
@@ -18,6 +18,7 @@
 package org.apache.phoenix.query;
 
 import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.INDEX_STATE_BYTES;
+import static 
org.apache.phoenix.query.QueryServicesOptions.DEFAULT_SKIP_SYSTEM_TABLES_EXISTENCE_CHECK;

Review Comment:
   imported but not used?



##########
phoenix-core/src/main/java/org/apache/phoenix/iterate/TableResultIterator.java:
##########
@@ -143,6 +143,20 @@ public TableResultIterator(MutationState mutationState, 
Scan scan, ScanMetricsHo
         ScanUtil.setScanAttributesForClient(scan, table, 
plan.getContext().getConnection());
     }
 
+    public TableResultIterator(MutationState mutationState, Scan scan, 
ScanMetricsHolder scanMetricsHolder,

Review Comment:
   Is this just visible for testing, or is this exposed to other things? (I 
believe this is a subtask of an improvement to hive-connector and 
spark-connector?)  
   
   A Javadoc or comment explaining its purpose would be helpful



##########
phoenix-core/src/it/java/org/apache/phoenix/query/SkipSystemTablesExistenceCheckIT.java:
##########
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.phoenix.query;
+
+import org.apache.phoenix.end2end.ParallelStatsDisabledIT;
+import org.apache.phoenix.end2end.ParallelStatsDisabledTest;
+import org.apache.phoenix.jdbc.PhoenixConnection;
+import org.apache.phoenix.jdbc.PhoenixStatement;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Properties;
+
+import static org.apache.phoenix.util.TestUtil.PHOENIX_JDBC_URL;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+
+@Category(ParallelStatsDisabledTest.class)
+@SuppressWarnings("deprecated")
+public class SkipSystemTablesExistenceCheckIT extends ParallelStatsDisabledIT {
+
+    @Test
+    public void testTableResultIterator() throws Exception {
+        Connection conn = DriverManager.getConnection(PHOENIX_JDBC_URL);
+        PhoenixConnection phoenixConnection = 
conn.unwrap(PhoenixConnection.class);
+        String tableName = generateUniqueName();
+
+        conn.createStatement().execute("CREATE TABLE " + tableName
+                + " (A UNSIGNED_LONG NOT NULL PRIMARY KEY, B VARCHAR(10))");
+        conn.createStatement().execute("UPSERT INTO " + tableName + " VALUES 
(1, 'A')");
+        conn.createStatement().execute("UPSERT INTO " + tableName + " VALUES 
(2, 'B')");
+        conn.createStatement().execute("UPSERT INTO " + tableName + " VALUES 
(3, 'C')");
+        conn.createStatement().execute("UPSERT INTO " + tableName + " VALUES 
(4, 'D')");
+        conn.commit();
+
+        scanTable(conn, tableName);
+        Properties props = new Properties();
+        props.setProperty(QueryServices.SKIP_SYSTEM_TABLES_EXISTENCE_CHECK, 
"true");
+        ConnectionQueryServicesImpl queryServices = 
((ConnectionQueryServicesImpl)phoenixConnection.getQueryServices());
+        queryServices.setInitialized(false);
+        queryServices.init(PHOENIX_JDBC_URL, props);

Review Comment:
   Not sure I understand the purpose of the test. Since we've already committed 
the connection, shouldn't scanTable find 4 rows regardless of whether the 
system catalog check is present, or how often we've initialized the CQSI? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to