[ 
https://issues.apache.org/jira/browse/HIVE-23965?focusedWorklogId=512895&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-512895
 ]

ASF GitHub Bot logged work on HIVE-23965:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 17/Nov/20 13:57
            Start Date: 17/Nov/20 13:57
    Worklog Time Spent: 10m 
      Work Description: kgyrtkirk commented on a change in pull request #1347:
URL: https://github.com/apache/hive/pull/1347#discussion_r525173227



##########
File path: 
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/dbinstall/rules/PostgresTPCDS.java
##########
@@ -0,0 +1,50 @@
+/*
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.hadoop.hive.metastore.dbinstall.rules;
+
+/**
+ * JUnit TestRule for Postgres metastore with TPCDS schema and stat 
information.
+ */
+public class PostgresTPCDS extends Postgres {
+  @Override
+  public String getDockerImageName() {
+    return "zabetak/postgres-tpcds-metastore:1.1";
+  }
+
+  @Override
+  public String getJdbcUrl() {
+    return "jdbc:postgresql://localhost:5432/metastore";
+  }
+
+  @Override
+  public String getHiveUser() {
+    return "hive";
+  }
+
+  @Override
+  public String getHivePassword() {
+    return "hive";
+  }
+
+  @Override
+  public void install() {
+    // Do not do anything since the postgres container contains a fully 
initialized

Review comment:
       I'm not sure about this..this will work for sure for now (and for a few 
day/weeks/months)
   
   ...but suppose we have a metastore schema change - the docker image will 
retain the old schema.
   for "master" we don't do incremental updates...so people doing MS changes 
will also need to rebuild tpcds image as well and upload a new image to 
dockerhub + change the imagename in this test?
   
   this might be cumbersome...but right now I'm still in favor of this patch if 
the above could "work"

##########
File path: 
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/dbinstall/rules/Postgres.java
##########
@@ -63,7 +67,15 @@ public String getInitialJdbcUrl() {
 
   @Override
   public boolean isContainerReady(String logOutput) {
-    return logOutput.contains("database system is ready to accept 
connections");
+    if (logOutput.contains("PostgreSQL init process complete; ready for start 
up")) {
+      try (Socket socket = new Socket()) {
+        socket.connect(new InetSocketAddress("localhost", 5432), 1000);

Review comment:
       does this mean that host system may not run a local psql server in case 
it wants to run this test?

##########
File path: 
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/dbinstall/rules/Postgres.java
##########
@@ -63,7 +67,15 @@ public String getInitialJdbcUrl() {
 
   @Override
   public boolean isContainerReady(String logOutput) {
-    return logOutput.contains("database system is ready to accept 
connections");
+    if (logOutput.contains("PostgreSQL init process complete; ready for start 
up")) {
+      try (Socket socket = new Socket()) {
+        socket.connect(new InetSocketAddress("localhost", 5432), 1000);

Review comment:
       I see now that this was "like this" before :)




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 512895)
    Time Spent: 4h  (was: 3h 50m)

> Improve plan regression tests using TPCDS30TB metastore dump and custom 
> configs
> -------------------------------------------------------------------------------
>
>                 Key: HIVE-23965
>                 URL: https://issues.apache.org/jira/browse/HIVE-23965
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Stamatis Zampetakis
>            Assignee: Stamatis Zampetakis
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 4h
>  Remaining Estimate: 0h
>
> The existing regression tests (HIVE-12586) based on TPC-DS have certain 
> shortcomings:
> The table statistics do not reflect cardinalities from a specific TPC-DS 
> scale factor (SF). Some tables are from a 30TB dataset, others from 200GB 
> dataset, and others from a 3GB dataset. This mix leads to plans that may 
> never appear when using an actual TPC-DS dataset. 
> The existing statistics do not contain information about partitions something 
> that can have a big impact on the resulting plans.
> The existing regression tests rely on more or less on the default 
> configuration (hive-site.xml). In real-life scenarios though some of the 
> configurations differ and may impact the choices of the optimizer.
> This issue aims to address the above shortcomings by using a curated 
> TPCDS30TB metastore dump along with some custom hive configurations. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to