You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/06/16 09:53:11 UTC

[GitHub] [incubator-kyuubi] hddong opened a new pull request, #2896: [KYUUBI #2895] Show final info in trino engine

hddong opened a new pull request, #2896:
URL: https://github.com/apache/incubator-kyuubi/pull/2896

   <!--
   Thanks for sending a pull request!
   
   Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
     2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
   -->
   
   ### _Why are the changes needed?_
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you add a feature, you can talk about the use case of it.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   
   ### _How was this patch tested?_
   - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
   
   - [ ] Add screenshots for manual tests if appropriate
   ![trino-process](https://user-images.githubusercontent.com/17537134/174044438-cfdda31f-a644-4753-81ef-7c62ea0a078c.png)
   
   - [X] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request
   


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] hddong commented on pull request #2896: [KYUUBI #2895] Show final info in trino engine

Posted by GitBox <gi...@apache.org>.
hddong commented on PR #2896:
URL: https://github.com/apache/incubator-kyuubi/pull/2896#issuecomment-1159899939

   @yaooqinn please review this again.
   cc @pan3793 


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] yaooqinn commented on a diff in pull request #2896: [KYUUBI #2895] Show final info in trino engine

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on code in PR #2896:
URL: https://github.com/apache/incubator-kyuubi/pull/2896#discussion_r899792466


##########
externals/kyuubi-trino-engine/src/main/scala/org/apache/kyuubi/engine/trino/TrinoConf.scala:
##########
@@ -39,4 +39,18 @@ object TrinoConf {
       .version("1.5.0")
       .timeConf
       .createWithDefault(Duration.ofMinutes(2).toMillis)
+
+  val ENGINE_TRINO_SHOW_PROGRESS: ConfigEntry[Boolean] =

Review Comment:
   these configs does not documented



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] cxzl25 commented on a diff in pull request #2896: [KYUUBI #2895] Show final info in trino engine

Posted by GitBox <gi...@apache.org>.
cxzl25 commented on code in PR #2896:
URL: https://github.com/apache/incubator-kyuubi/pull/2896#discussion_r901753612


##########
externals/kyuubi-trino-engine/src/main/scala/org/apache/kyuubi/engine/trino/TrinoStatusPrinter.scala:
##########
@@ -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.kyuubi.engine.trino
+
+import java.util.concurrent.TimeUnit._
+
+import io.airlift.units.DataSize
+import io.airlift.units.Duration
+import io.trino.client.StatementClient
+
+import org.apache.kyuubi.engine.trino.ProgressFormatUtils._
+import org.apache.kyuubi.operation.log.OperationLog
+
+/**
+ * Copy from trino-cli
+ *   1. use OperationLog instead PrintStream to out status info
+ */
+object TrinoStatusPrinter {
+
+  def printFinalInfo(
+      client: StatementClient,
+      operationLog: OperationLog,
+      debug: Boolean = false): Unit = {
+    val out = new TrinoConsoleProgressBar(operationLog)
+    val results = client.finalStatusInfo()
+    val stats = results.getStats()
+
+    val wallTime = Duration.succinctDuration(stats.getElapsedTimeMillis(), MILLISECONDS)
+
+    val nodes = stats.getNodes()
+    if ((nodes == 0) || (stats.getTotalSplits() == 0)) {
+      return
+    }
+
+    // Query 12, FINISHED, 1 node
+    val querySummary = s"Query ${results.getId()}, ${stats.getState()}," +
+      s" ${nodes.formatted("%,d")} ${pluralize("node", nodes)}"
+    out.printLine(querySummary)
+
+    if (debug) {
+      out.printLine(results.getInfoUri().toString())
+    }
+
+    // Splits: 1000 total, 842 done (84.20%)
+    val splitsSummary = s"Splits: ${stats.getTotalSplits().formatted("%,d")} total," +
+      s" ${stats.getCompletedSplits().formatted("%,d")}" +
+      s" done (${stats.getProgressPercentage().orElse(0.0).formatted("%.2f")}%)"
+    out.printLine(splitsSummary)
+
+    if (debug) {
+      // CPU Time: 565.2s total,   26K rows/s, 3.85MB/s
+      val cpuTime = new Duration(stats.getCpuTimeMillis(), MILLISECONDS)
+      val cpuTimeSummary = s"CPU Time: ${cpuTime.getValue(SECONDS).formatted("%.1f")}s total, " +
+        s"${formatCountRate(
+          stats.getProcessedRows(),
+          cpuTime,
+          false).formatted("%5s")} rows/s, " +
+        s"${formatDataRate(
+          DataSize.ofBytes(stats.getProcessedBytes()),
+          cpuTime,
+          true).formatted("%8s")}, " +
+        s"${percentage(
+          stats.getCpuTimeMillis(),
+          stats.getWallTimeMillis()).formatted("%d")}% active"
+      out.printLine(cpuTimeSummary)
+
+      val parallelism = cpuTime.getValue(MILLISECONDS) / wallTime.getValue(MILLISECONDS);

Review Comment:
   nit: remove `;`
   
   Can we get rid of these parentheses?
   
   ![image](https://user-images.githubusercontent.com/3898450/174626920-acf906ac-b2d4-4ea0-b541-2bc909e012c5.png)
   



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] hddong commented on a diff in pull request #2896: [KYUUBI #2895] Show final info in trino engine

Posted by GitBox <gi...@apache.org>.
hddong commented on code in PR #2896:
URL: https://github.com/apache/incubator-kyuubi/pull/2896#discussion_r902093368


##########
externals/kyuubi-trino-engine/src/main/scala/org/apache/kyuubi/engine/trino/TrinoStatusPrinter.scala:
##########
@@ -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.kyuubi.engine.trino
+
+import java.util.concurrent.TimeUnit._
+
+import io.airlift.units.DataSize
+import io.airlift.units.Duration
+import io.trino.client.StatementClient
+
+import org.apache.kyuubi.engine.trino.ProgressFormatUtils._
+import org.apache.kyuubi.operation.log.OperationLog
+
+/**
+ * Copy from trino-cli
+ *   1. use OperationLog instead PrintStream to out status info
+ */
+object TrinoStatusPrinter {
+
+  def printFinalInfo(
+      client: StatementClient,
+      operationLog: OperationLog,
+      debug: Boolean = false): Unit = {
+    val out = new TrinoConsoleProgressBar(operationLog)
+    val results = client.finalStatusInfo()
+    val stats = results.getStats()
+
+    val wallTime = Duration.succinctDuration(stats.getElapsedTimeMillis(), MILLISECONDS)

Review Comment:
   > what is FormatUtils?
   
   https://github.com/apache/incubator-kyuubi/pull/2896/files#diff-16f6ae2d81713d0c45408cbd4a43eda8612a42e461691f04033672ad858a5e8dR34-R37
   ```
   /** Copy from trino-cli `FormatUtils` */
   public final class ProgressFormatUtils {
     private ProgressFormatUtils() {}
   ```
   Used to format output data and process ba.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] hddong commented on a diff in pull request #2896: [KYUUBI #2895] Show final info in trino engine

Posted by GitBox <gi...@apache.org>.
hddong commented on code in PR #2896:
URL: https://github.com/apache/incubator-kyuubi/pull/2896#discussion_r899836623


##########
externals/kyuubi-trino-engine/src/main/scala/org/apache/kyuubi/engine/trino/TrinoStatusPrinter.scala:
##########
@@ -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.kyuubi.engine.trino
+
+import java.util.concurrent.TimeUnit._
+
+import io.airlift.units.DataSize
+import io.airlift.units.Duration
+import io.trino.client.StatementClient
+
+import org.apache.kyuubi.engine.trino.ProgressFormatUtils._
+import org.apache.kyuubi.operation.log.OperationLog
+
+/**
+ * Copy from trino-cli
+ *   1. use OperationLog instead PrintStream to out status info
+ */
+object TrinoStatusPrinter {
+
+  def printFinalInfo(
+      client: StatementClient,
+      operationLog: OperationLog,
+      debug: Boolean = false): Unit = {
+    val out = new TrinoConsoleProgressBar(operationLog)
+    val results = client.finalStatusInfo()
+    val stats = results.getStats()
+
+    val wallTime = Duration.succinctDuration(stats.getElapsedTimeMillis(), MILLISECONDS)

Review Comment:
   > why not use millis directly?
   
   It is used to covert millis to Duration, to pass to functions in `FormatUtils`.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] yaooqinn commented on a diff in pull request #2896: [KYUUBI #2895] Show final info in trino engine

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on code in PR #2896:
URL: https://github.com/apache/incubator-kyuubi/pull/2896#discussion_r899793509


##########
externals/kyuubi-trino-engine/src/main/scala/org/apache/kyuubi/engine/trino/TrinoStatusPrinter.scala:
##########
@@ -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.kyuubi.engine.trino
+
+import java.util.concurrent.TimeUnit._
+
+import io.airlift.units.DataSize
+import io.airlift.units.Duration

Review Comment:
   do we need these?



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] hddong commented on a diff in pull request #2896: [KYUUBI #2895] Show final info in trino engine

Posted by GitBox <gi...@apache.org>.
hddong commented on code in PR #2896:
URL: https://github.com/apache/incubator-kyuubi/pull/2896#discussion_r899835058


##########
externals/kyuubi-trino-engine/src/main/scala/org/apache/kyuubi/engine/trino/TrinoStatusPrinter.scala:
##########
@@ -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.kyuubi.engine.trino
+
+import java.util.concurrent.TimeUnit._
+
+import io.airlift.units.DataSize
+import io.airlift.units.Duration

Review Comment:
   Functions(`formatDataRate(DataSize dataSize, Duration duration, boolean longForm)`) in `FormatUtils` need these types to format output string.



##########
externals/kyuubi-trino-engine/src/main/scala/org/apache/kyuubi/engine/trino/TrinoStatusPrinter.scala:
##########
@@ -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.kyuubi.engine.trino
+
+import java.util.concurrent.TimeUnit._
+
+import io.airlift.units.DataSize
+import io.airlift.units.Duration

Review Comment:
   Functions(such as `formatDataRate(DataSize dataSize, Duration duration, boolean longForm)`) in `FormatUtils` need these types to format output string.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] hddong commented on a diff in pull request #2896: [KYUUBI #2895] Show final info in trino engine

Posted by GitBox <gi...@apache.org>.
hddong commented on code in PR #2896:
URL: https://github.com/apache/incubator-kyuubi/pull/2896#discussion_r899831763


##########
externals/kyuubi-trino-engine/src/main/scala/org/apache/kyuubi/engine/trino/TrinoConf.scala:
##########
@@ -39,4 +39,18 @@ object TrinoConf {
       .version("1.5.0")
       .timeConf
       .createWithDefault(Duration.ofMinutes(2).toMillis)
+
+  val ENGINE_TRINO_SHOW_PROGRESS: ConfigEntry[Boolean] =

Review Comment:
   Had move to `KyuubiConf`.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] hddong commented on pull request #2896: [KYUUBI #2895] Show final info in trino engine

Posted by GitBox <gi...@apache.org>.
hddong commented on PR #2896:
URL: https://github.com/apache/incubator-kyuubi/pull/2896#issuecomment-1158515238

   > unnecessary and heavy for metadata operations to create operation log.
   
   @yaooqinn Removed from metadata oprations.
   
   
   
   


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] yaooqinn commented on a diff in pull request #2896: [KYUUBI #2895] Show final info in trino engine

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on code in PR #2896:
URL: https://github.com/apache/incubator-kyuubi/pull/2896#discussion_r899794138


##########
externals/kyuubi-trino-engine/src/main/scala/org/apache/kyuubi/engine/trino/TrinoStatusPrinter.scala:
##########
@@ -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.kyuubi.engine.trino
+
+import java.util.concurrent.TimeUnit._
+
+import io.airlift.units.DataSize
+import io.airlift.units.Duration
+import io.trino.client.StatementClient
+
+import org.apache.kyuubi.engine.trino.ProgressFormatUtils._
+import org.apache.kyuubi.operation.log.OperationLog
+
+/**
+ * Copy from trino-cli
+ *   1. use OperationLog instead PrintStream to out status info
+ */
+object TrinoStatusPrinter {
+
+  def printFinalInfo(
+      client: StatementClient,
+      operationLog: OperationLog,
+      debug: Boolean = false): Unit = {
+    val out = new TrinoConsoleProgressBar(operationLog)
+    val results = client.finalStatusInfo()
+    val stats = results.getStats()
+
+    val wallTime = Duration.succinctDuration(stats.getElapsedTimeMillis(), MILLISECONDS)

Review Comment:
   why not use millis directly?



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] ulysses-you commented on pull request #2896: [KYUUBI #2895] Show final info in trino engine

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on PR #2896:
URL: https://github.com/apache/incubator-kyuubi/pull/2896#issuecomment-1160047493

   cc @cxzl25 


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] hddong commented on pull request #2896: [KYUUBI #2895] Show final info in trino engine

Posted by GitBox <gi...@apache.org>.
hddong commented on PR #2896:
URL: https://github.com/apache/incubator-kyuubi/pull/2896#issuecomment-1174496409

   thanks, merged to master


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] codecov-commenter commented on pull request #2896: [KYUUBI #2895] Show final info in trino engine

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #2896:
URL: https://github.com/apache/incubator-kyuubi/pull/2896#issuecomment-1158444752

   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/2896?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2896](https://codecov.io/gh/apache/incubator-kyuubi/pull/2896?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (30ba035) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/27330ddb8e93dfeb5fc7ede619afe3e2e135b701?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (27330dd) will **increase** coverage by `0.28%`.
   > The diff coverage is `45.93%`.
   
   > :exclamation: Current head 30ba035 differs from pull request most recent head 3edbdfb. Consider uploading reports for the commit 3edbdfb to get more accurate results
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2896      +/-   ##
   ============================================
   + Coverage     63.79%   64.08%   +0.28%     
   - Complexity      205      215      +10     
   ============================================
     Files           508      520      +12     
     Lines         22258    23051     +793     
     Branches       2942     2996      +54     
   ============================================
   + Hits          14200    14772     +572     
   - Misses         6724     6871     +147     
   - Partials       1334     1408      +74     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/2896?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...pache/kyuubi/engine/trino/ProgressFormatUtils.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/2896/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2t5dXViaS9lbmdpbmUvdHJpbm8vUHJvZ3Jlc3NGb3JtYXRVdGlscy5qYXZh) | `35.18% <35.18%> (ø)` | |
   | [...pache/kyuubi/engine/trino/TrinoStatusPrinter.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/2896/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL1RyaW5vU3RhdHVzUHJpbnRlci5zY2FsYQ==) | `36.66% <36.66%> (ø)` | |
   | [...rg/apache/kyuubi/engine/trino/TrinoStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/2896/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL1RyaW5vU3RhdGVtZW50LnNjYWxh) | `75.38% <62.50%> (-2.59%)` | :arrow_down: |
   | [.../kyuubi/engine/trino/TrinoConsoleProgressBar.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/2896/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL1RyaW5vQ29uc29sZVByb2dyZXNzQmFyLnNjYWxh) | `66.66% <66.66%> (ø)` | |
   | [...ala/org/apache/kyuubi/engine/trino/TrinoConf.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/2896/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL1RyaW5vQ29uZi5zY2FsYQ==) | `100.00% <100.00%> (ø)` | |
   | [...uubi/engine/trino/operation/ExecuteStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/2896/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL29wZXJhdGlvbi9FeGVjdXRlU3RhdGVtZW50LnNjYWxh) | `81.81% <100.00%> (+0.33%)` | :arrow_up: |
   | [...he/kyuubi/engine/trino/operation/GetCatalogs.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/2896/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL29wZXJhdGlvbi9HZXRDYXRhbG9ncy5zY2FsYQ==) | `91.66% <100.00%> (+1.66%)` | :arrow_up: |
   | [...che/kyuubi/engine/trino/operation/GetColumns.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/2896/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL29wZXJhdGlvbi9HZXRDb2x1bW5zLnNjYWxh) | `89.28% <100.00%> (+0.39%)` | :arrow_up: |
   | [...che/kyuubi/engine/trino/operation/GetSchemas.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/2896/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL29wZXJhdGlvbi9HZXRTY2hlbWFzLnNjYWxh) | `86.36% <100.00%> (+1.36%)` | :arrow_up: |
   | [.../kyuubi/engine/trino/operation/GetTableTypes.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/2896/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL29wZXJhdGlvbi9HZXRUYWJsZVR5cGVzLnNjYWxh) | `91.66% <100.00%> (+1.66%)` | :arrow_up: |
   | ... and [48 more](https://codecov.io/gh/apache/incubator-kyuubi/pull/2896/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/2896?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/2896?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [27330dd...3edbdfb](https://codecov.io/gh/apache/incubator-kyuubi/pull/2896?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] yaooqinn commented on pull request #2896: [KYUUBI #2895] Show final info in trino engine

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on PR #2896:
URL: https://github.com/apache/incubator-kyuubi/pull/2896#issuecomment-1157498413

   unnecessary and heavy for metadata operations to create operation log.


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] hddong commented on a diff in pull request #2896: [KYUUBI #2895] Show final info in trino engine

Posted by GitBox <gi...@apache.org>.
hddong commented on code in PR #2896:
URL: https://github.com/apache/incubator-kyuubi/pull/2896#discussion_r902093661


##########
externals/kyuubi-trino-engine/src/main/scala/org/apache/kyuubi/engine/trino/TrinoStatusPrinter.scala:
##########
@@ -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.kyuubi.engine.trino
+
+import java.util.concurrent.TimeUnit._
+
+import io.airlift.units.DataSize
+import io.airlift.units.Duration
+import io.trino.client.StatementClient
+
+import org.apache.kyuubi.engine.trino.ProgressFormatUtils._
+import org.apache.kyuubi.operation.log.OperationLog
+
+/**
+ * Copy from trino-cli
+ *   1. use OperationLog instead PrintStream to out status info
+ */
+object TrinoStatusPrinter {
+
+  def printFinalInfo(
+      client: StatementClient,
+      operationLog: OperationLog,
+      debug: Boolean = false): Unit = {
+    val out = new TrinoConsoleProgressBar(operationLog)
+    val results = client.finalStatusInfo()
+    val stats = results.getStats()
+
+    val wallTime = Duration.succinctDuration(stats.getElapsedTimeMillis(), MILLISECONDS)
+
+    val nodes = stats.getNodes()
+    if ((nodes == 0) || (stats.getTotalSplits() == 0)) {
+      return
+    }
+
+    // Query 12, FINISHED, 1 node
+    val querySummary = s"Query ${results.getId()}, ${stats.getState()}," +
+      s" ${nodes.formatted("%,d")} ${pluralize("node", nodes)}"
+    out.printLine(querySummary)
+
+    if (debug) {
+      out.printLine(results.getInfoUri().toString())
+    }
+
+    // Splits: 1000 total, 842 done (84.20%)
+    val splitsSummary = s"Splits: ${stats.getTotalSplits().formatted("%,d")} total," +
+      s" ${stats.getCompletedSplits().formatted("%,d")}" +
+      s" done (${stats.getProgressPercentage().orElse(0.0).formatted("%.2f")}%)"
+    out.printLine(splitsSummary)
+
+    if (debug) {
+      // CPU Time: 565.2s total,   26K rows/s, 3.85MB/s
+      val cpuTime = new Duration(stats.getCpuTimeMillis(), MILLISECONDS)
+      val cpuTimeSummary = s"CPU Time: ${cpuTime.getValue(SECONDS).formatted("%.1f")}s total, " +
+        s"${formatCountRate(
+          stats.getProcessedRows(),
+          cpuTime,
+          false).formatted("%5s")} rows/s, " +
+        s"${formatDataRate(
+          DataSize.ofBytes(stats.getProcessedBytes()),
+          cpuTime,
+          true).formatted("%8s")}, " +
+        s"${percentage(
+          stats.getCpuTimeMillis(),
+          stats.getWallTimeMillis()).formatted("%d")}% active"
+      out.printLine(cpuTimeSummary)
+
+      val parallelism = cpuTime.getValue(MILLISECONDS) / wallTime.getValue(MILLISECONDS);

Review Comment:
   > nit: remove `;`
   > 
   > Can we get rid of these parentheses?
   
   Thanks, all done.
   



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] yaooqinn commented on a diff in pull request #2896: [KYUUBI #2895] Show final info in trino engine

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on code in PR #2896:
URL: https://github.com/apache/incubator-kyuubi/pull/2896#discussion_r901209853


##########
externals/kyuubi-trino-engine/src/main/scala/org/apache/kyuubi/engine/trino/TrinoStatusPrinter.scala:
##########
@@ -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.kyuubi.engine.trino
+
+import java.util.concurrent.TimeUnit._
+
+import io.airlift.units.DataSize
+import io.airlift.units.Duration
+import io.trino.client.StatementClient
+
+import org.apache.kyuubi.engine.trino.ProgressFormatUtils._
+import org.apache.kyuubi.operation.log.OperationLog
+
+/**
+ * Copy from trino-cli
+ *   1. use OperationLog instead PrintStream to out status info
+ */
+object TrinoStatusPrinter {
+
+  def printFinalInfo(
+      client: StatementClient,
+      operationLog: OperationLog,
+      debug: Boolean = false): Unit = {
+    val out = new TrinoConsoleProgressBar(operationLog)
+    val results = client.finalStatusInfo()
+    val stats = results.getStats()
+
+    val wallTime = Duration.succinctDuration(stats.getElapsedTimeMillis(), MILLISECONDS)

Review Comment:
   what is FormatUtils?



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] hddong closed pull request #2896: [KYUUBI #2895] Show final info in trino engine

Posted by GitBox <gi...@apache.org>.
hddong closed pull request #2896: [KYUUBI #2895] Show final info in trino engine
URL: https://github.com/apache/incubator-kyuubi/pull/2896


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org