richardantal commented on a change in pull request #1321:
URL: https://github.com/apache/phoenix/pull/1321#discussion_r732623672



##########
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexWithDefaultValueIT.java
##########
@@ -0,0 +1,125 @@
+/*
+ * 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.end2end;
+
+
+import org.junit.Test;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.Properties;
+
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertEquals;
+
+
+public class IndexWithDefaultValueIT extends ParallelStatsDisabledIT {
+
+    @Test
+    public void testQueryTableWithIndex() throws Exception {
+        String tableName = generateUniqueName();
+        String indexName = generateUniqueName();
+
+        Properties props = new Properties();
+        String schema = generateUniqueName();
+        Connection conn = DriverManager.getConnection(getUrl(), props);
+
+        conn.setSchema(schema);
+        conn.createStatement().execute("\n" +
+                "create table " + tableName + "(\n" +
+                "pk VARCHAR,\n" +
+                "b VARCHAR,\n" +
+                "c VARCHAR default '0',\n" +
+                "CONSTRAINT my_pk PRIMARY KEY (pk)\n" +
+                ")");
+
+        conn.commit();
+
+        conn.createStatement().execute("upsert into " + tableName + " 
values('1','1','1')");
+        conn.commit();
+
+        conn.createStatement().execute("CREATE INDEX " + indexName + " ON " + 
tableName + "(pk, b, c)");
+        conn.commit();
+
+
+        final PreparedStatement select = conn.prepareStatement(
+                "select * from " + tableName);

Review comment:
       This test is intended to test if it is possible to overwrite the default 
value when we provide a value.
   In the other test ln 116, 118 Checks the reading of the default value when 
no value provided.




-- 
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