From issues-return-4417-archive-asf-public=cust-asf.ponee.io@phoenix.apache.org Mon Feb 4 22:15:56 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 21402180679 for ; Mon, 4 Feb 2019 23:15:55 +0100 (CET) Received: (qmail 33627 invoked by uid 500); 4 Feb 2019 22:15:55 -0000 Mailing-List: contact issues-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list issues@phoenix.apache.org Received: (qmail 33618 invoked by uid 99); 4 Feb 2019 22:15:55 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Feb 2019 22:15:55 +0000 From: GitBox To: issues@phoenix.apache.org Subject: =?utf-8?q?=5BGitHub=5D_gokceni_commented_on_a_change_in_pull_request_=234?= =?utf-8?q?34=3A_PHOENIX-5018_Index_mutations_created_by_UPSERT_SELECT_wil?= =?utf-8?b?bCBoYXZlIHdyb25n4oCm?= Message-ID: <154931855466.4617.14331429726619482050.gitbox@gitbox.apache.org> Date: Mon, 04 Feb 2019 22:15:54 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit gokceni commented on a change in pull request #434: PHOENIX-5018 Index mutations created by UPSERT SELECT will have wrong… URL: https://github.com/apache/phoenix/pull/434#discussion_r253667863 ########## File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexBuildTimestampIT.java ########## @@ -0,0 +1,299 @@ +/* + * 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 static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.UUID; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.client.ResultScanner; +import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.client.Table; +import org.apache.phoenix.jdbc.PhoenixConnection; +import org.apache.phoenix.jdbc.PhoenixResultSet; +import org.apache.phoenix.mapreduce.index.IndexTool; +import org.apache.phoenix.query.QueryServices; +import org.apache.phoenix.query.QueryServicesOptions; +import org.apache.phoenix.schema.PTable; +import org.apache.phoenix.util.EnvironmentEdge; +import org.apache.phoenix.util.EnvironmentEdgeManager; +import org.apache.phoenix.util.PhoenixRuntime; +import org.apache.phoenix.util.QueryUtil; +import org.apache.phoenix.util.ReadOnlyProps; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; + +@RunWith(Parameterized.class) +public class IndexBuildTimestampIT extends BaseUniqueNamesOwnClusterIT { + private final boolean localIndex; + private final boolean async; + private final String tableDDLOptions; + + public IndexBuildTimestampIT(boolean mutable, boolean localIndex, + boolean async) { + this.localIndex = localIndex; + this.async = async; + StringBuilder optionBuilder = new StringBuilder(); + if (!mutable) { + optionBuilder.append(" IMMUTABLE_ROWS=true "); + } + optionBuilder.append(" SPLIT ON(1,2)"); + this.tableDDLOptions = optionBuilder.toString(); + } + + @BeforeClass + public static void setup() throws Exception { + Map serverProps = Maps.newHashMapWithExpectedSize(2); + serverProps.put(QueryServices.STATS_GUIDEPOST_WIDTH_BYTES_ATTRIB, Long.toString(20)); + serverProps.put(QueryServices.MAX_SERVER_METADATA_CACHE_TIME_TO_LIVE_MS_ATTRIB, Long.toString(5)); + serverProps.put(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB, + QueryServicesOptions.DEFAULT_EXTRA_JDBC_ARGUMENTS); + Map clientProps = Maps.newHashMapWithExpectedSize(2); + clientProps.put(QueryServices.USE_STATS_FOR_PARALLELIZATION, Boolean.toString(true)); + clientProps.put(QueryServices.STATS_UPDATE_FREQ_MS_ATTRIB, Long.toString(5)); + clientProps.put(QueryServices.TRANSACTIONS_ENABLED, Boolean.TRUE.toString()); + clientProps.put(QueryServices.FORCE_ROW_KEY_ORDER_ATTRIB, Boolean.TRUE.toString()); + setUpTestDriver(new ReadOnlyProps(serverProps.entrySet().iterator()), + new ReadOnlyProps(clientProps.entrySet().iterator())); + } + + @Parameters( + name = "mutable={0},localIndex={1},async={2}") + public static Collection data() { + List list = Lists.newArrayListWithExpectedSize(8); + boolean[] Booleans = new boolean[]{false, true}; + for (boolean mutable : Booleans) { + for (boolean localIndex : Booleans) { + for (boolean async : Booleans) { + list.add(new Object[]{mutable, localIndex, async}); + } + } + } + return list; + } + + public static void assertExplainPlan(Connection conn, boolean localIndex, String selectSql, Review comment: I see that IndexToolIT has the same method with this name. Can we have a utility class and copy this one there and use from both places? I see that the other doesn't take connection as parameter. Perhaps a little refactor might be necessary. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services