You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by "Kwafoor (via GitHub)" <gi...@apache.org> on 2023/12/29 02:02:44 UTC
[PR] [KYUUBI #5797] Support to describe engine with command in current ses… [kyuubi]
Kwafoor opened a new pull request, #5931:
URL: https://github.com/apache/kyuubi/pull/5931
# :mag: Description
## Issue References 🔗
<!-- Append the issue number after #. If there is no issue for you to link create one or -->
<!-- If there are no issues to link, please provide details here. -->
This pull request fixes #5797
## Describe Your Solution 🔧
Support to describe engine with command in current session.
## Types of changes :bookmark:
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bugfix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
## Test Plan 🧪
#### Behavior Without This Pull Request :coffin:
#### Behavior With This Pull Request :tada:
user can use sql `KYUUBI DESCRIBE[DESC] ENGINE` to show engine info.
#### Related Unit Tests
---
# Checklist 📝
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)
**Be nice. Be informative.**
--
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
Re: [PR] [KYUUBI #5797] Support to describe engine with command in current session [kyuubi]
Posted by "turboFei (via GitHub)" <gi...@apache.org>.
turboFei commented on code in PR #5931:
URL: https://github.com/apache/kyuubi/pull/5931#discussion_r1440679545
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/sql/plan/command/DescribeEngine.scala:
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.sql.plan.command
+
+import scala.collection.mutable.ListBuffer
+
+import org.apache.kyuubi.operation.IterableFetchIterator
+import org.apache.kyuubi.session.{KyuubiSession, KyuubiSessionImpl}
+import org.apache.kyuubi.shaded.hive.service.rpc.thrift.TTypeId
+import org.apache.kyuubi.sql.schema.{Column, Row, Schema}
+
+/**
+ * A runnable node for description the current session engine.
+ *
+ * The syntax of using this command in SQL is:
+ * {{{
+ * [DESC|DESCRIBE] ENGINE;
+ * }}}
+ */
+case class DescribeEngine() extends RunnableCommand {
+
+ override def run(kyuubiSession: KyuubiSession): Unit = {
+ val rows = Seq(kyuubiSession).map { session =>
+ lazy val client = session.asInstanceOf[KyuubiSessionImpl].client
+ val values = new ListBuffer[String]()
+ values += client.engineId.getOrElse("")
+ values += client.engineName.getOrElse("")
+ values += client.engineUrl.getOrElse("")
+ Row(values.toList)
+ }
+ iter = new IterableFetchIterator(rows)
+ }
+
+ override def resultSchema: Schema = {
+ Schema(DescribeEngine.outputCols().toList)
+ }
+
+ override def name(): String = "Describe Engine Node"
+}
+
+object DescribeEngine {
+
+ def outputCols(): Seq[Column] = {
+ Seq(
+ Column("ENGINE_ID", TTypeId.STRING_TYPE, Some("Kyuubi engine identify")),
+ Column("ENGINE_NAME", TTypeId.STRING_TYPE, Some("Kyuubi engine name")),
+ Column("ENGINE_URL", TTypeId.STRING_TYPE, Some("Kyuubi engine url")))
Review Comment:
could you raise a follow up pr to showthee engine registered attributes?
FYI: Refer the kyuubi-admin get engine command.
--
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
Re: [PR] [KYUUBI #5797] Support to describe engine with command in current ses… [kyuubi]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #5931:
URL: https://github.com/apache/kyuubi/pull/5931#issuecomment-1871701015
## [Codecov](https://app.codecov.io/gh/apache/kyuubi/pull/5931?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
Attention: `1 lines` in your changes are missing coverage. Please review.
> Comparison is base [(`65b631b`)](https://app.codecov.io/gh/apache/kyuubi/commit/65b631beb67e932953e5f558ed929eb3bd3872b2?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 61.52% compared to head [(`4746fa6`)](https://app.codecov.io/gh/apache/kyuubi/pull/5931?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 61.49%.
| [Files](https://app.codecov.io/gh/apache/kyuubi/pull/5931?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...pache/kyuubi/sql/plan/command/DescribeEngine.scala](https://app.codecov.io/gh/apache/kyuubi/pull/5931?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9zcWwvcGxhbi9jb21tYW5kL0Rlc2NyaWJlRW5naW5lLnNjYWxh) | 94.11% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/kyuubi/pull/5931?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #5931 +/- ##
============================================
- Coverage 61.52% 61.49% -0.03%
Complexity 23 23
============================================
Files 616 617 +1
Lines 36412 36430 +18
Branches 4987 4987
============================================
+ Hits 22401 22402 +1
- Misses 11574 11602 +28
+ Partials 2437 2426 -11
```
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/kyuubi/pull/5931?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
--
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
Re: [PR] [KYUUBI #5797] Support to describe engine with command in current session [kyuubi]
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 closed pull request #5931: [KYUUBI #5797] Support to describe engine with command in current session
URL: https://github.com/apache/kyuubi/pull/5931
--
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
Re: [PR] [KYUUBI #5797] Support to describe engine with command in current session [kyuubi]
Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on PR #5931:
URL: https://github.com/apache/kyuubi/pull/5931#issuecomment-1876817170
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
Re: [PR] [KYUUBI #5797] Support to describe engine with command in current ses… [kyuubi]
Posted by "wForget (via GitHub)" <gi...@apache.org>.
wForget commented on code in PR #5931:
URL: https://github.com/apache/kyuubi/pull/5931#discussion_r1437996158
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/sql/plan/command/DescribeEngine.scala:
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.sql.plan.command
+
+import scala.collection.mutable.ListBuffer
+
+import org.apache.kyuubi.operation.IterableFetchIterator
+import org.apache.kyuubi.session.{KyuubiSession, KyuubiSessionImpl}
+import org.apache.kyuubi.shaded.hive.service.rpc.thrift.TTypeId
+import org.apache.kyuubi.sql.schema.{Column, Row, Schema}
+
+/**
+ * A runnable node for description the current session.
Review Comment:
Please update the description
--
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
Re: [PR] [KYUUBI #5797] Support to describe engine with command in current ses… [kyuubi]
Posted by "Kwafoor (via GitHub)" <gi...@apache.org>.
Kwafoor commented on PR #5931:
URL: https://github.com/apache/kyuubi/pull/5931#issuecomment-1871700538
@bowenliang123 @turboFei @wForget cc
--
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