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/12/26 05:32:16 UTC
[GitHub] [kyuubi] ulysses-you opened a new pull request, #4030: [KYUUBI #4029] Support trino get schemas
ulysses-you opened a new pull request, #4030:
URL: https://github.com/apache/kyuubi/pull/4030
<!--
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/CONTRIBUTING.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.
-->
Support Trino get schemas statement. We convert statement to operation at Trino frontend.
Note, this pr does not support the whole code path from Trino frontend. This pr aims to add an example how to make Trino frontend work with existed Kyuubi server framework.
### _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
- [ ] [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] [kyuubi] Yikf commented on a diff in pull request #4030: [KYUUBI #4029] Support trino get schemas
Posted by GitBox <gi...@apache.org>.
Yikf commented on code in PR #4030:
URL: https://github.com/apache/kyuubi/pull/4030#discussion_r1057087456
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/trino/api/KyuubiTrinoOperationTranslator.scala:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.server.trino.api
+
+import org.apache.hive.service.rpc.thrift.TProtocolVersion
+
+import org.apache.kyuubi.operation.OperationHandle
+import org.apache.kyuubi.service.BackendService
+import org.apache.kyuubi.session.KyuubiSessionManager
+import org.apache.kyuubi.sql.trino.TrinoGetSchemas
+
+class KyuubiTrinoOperationTranslator(backendService: BackendService) {
+ lazy val parser = backendService.sessionManager.asInstanceOf[KyuubiSessionManager].parser
Review Comment:
We aims to have another parser for transform operation with trino fe, in other words
1. reuse KyuubiSqlBaseLexer.g4 file.
2. new KyuubiTrinoFeBaseParser file.
3. make a KyuubiParserBase to abstract the parser
btw, in future, maybe need a new KyuubiMysqlFe parser to translate.
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/trino/api/KyuubiTrinoOperationTranslator.scala:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.server.trino.api
+
+import org.apache.hive.service.rpc.thrift.TProtocolVersion
+
+import org.apache.kyuubi.operation.OperationHandle
+import org.apache.kyuubi.service.BackendService
+import org.apache.kyuubi.session.KyuubiSessionManager
+import org.apache.kyuubi.sql.trino.TrinoGetSchemas
+
+class KyuubiTrinoOperationTranslator(backendService: BackendService) {
+ lazy val parser = backendService.sessionManager.asInstanceOf[KyuubiSessionManager].parser
+
+ def transform(
+ statement: String,
+ user: String,
+ ipAddress: String,
+ configs: Map[String, String]): OperationHandle = {
+ val sessionHandle = backendService.openSession(
+ TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V11,
+ user,
+ "",
+ ipAddress,
+ configs)
+ parser.parsePlan(statement) match {
+ case TrinoGetSchemas(catalogName, schemaPattern) =>
+ backendService.getSchemas(sessionHandle, catalogName, schemaPattern)
+ case _ => throw new UnsupportedOperationException()
Review Comment:
Here maybe should have a `PassThrough` for execute statement (be.executeStatement)
##########
kyuubi-server/src/test/scala/org/apache/kyuubi/parser/trino/KyuubiTrinoStatementSuite.scala:
##########
@@ -0,0 +1,68 @@
+/*
+ * 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.parser.trino
+
+import org.apache.kyuubi.KyuubiFunSuite
+import org.apache.kyuubi.sql.parser.KyuubiParser
+import org.apache.kyuubi.sql.trino.TrinoGetSchemas
+
+class KyuubiTrinoStatementSuite extends KyuubiFunSuite {
Review Comment:
We can have an end-to-end test if the trino resource work 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] [kyuubi] yaooqinn commented on a diff in pull request #4030: [KYUUBI #4029] Support trino get schemas
Posted by GitBox <gi...@apache.org>.
yaooqinn commented on code in PR #4030:
URL: https://github.com/apache/kyuubi/pull/4030#discussion_r1057399726
##########
kyuubi-server/src/main/antlr4/org/apache/kyuubi/sql/KyuubiSqlBaseParser.g4:
##########
@@ -24,8 +24,11 @@ singleStatement
;
statement
- : (KYUUBI | KYUUBIADMIN) runnableCommand #runnable
- | .*? #passThrough
+ : (KYUUBI | KYUUBIADMIN) runnableCommand #runnable
+ | SELECT TABLE_SCHEM COMMA TABLE_CATALOG FROM SYSTEM_JDBC_SCHEMAS
Review Comment:
I suggest you create the trino parser separately. Otherwise, this needs to be marked as a BLOCKER for next release
--
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] [kyuubi] ulysses-you commented on a diff in pull request #4030: [KYUUBI #4029] Support trino get schemas
Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #4030:
URL: https://github.com/apache/kyuubi/pull/4030#discussion_r1057105037
##########
kyuubi-server/src/main/antlr4/org/apache/kyuubi/sql/KyuubiSqlBaseParser.g4:
##########
@@ -24,8 +24,11 @@ singleStatement
;
statement
- : (KYUUBI | KYUUBIADMIN) runnableCommand #runnable
- | .*? #passThrough
+ : (KYUUBI | KYUUBIADMIN) runnableCommand #runnable
+ | SELECT TABLE_SCHEM COMMA TABLE_CATALOG FROM SYSTEM_JDBC_SCHEMAS
+ (WHERE (TABLE_CATALOG EQ catalog=STRING+)? AND? (TABLE_SCHEM LIKE schema=STRING+)?)?
+ (ORDER BY TABLE_CATALOG COMMA TABLE_SCHEM)? #getSchemas
Review Comment:
do you mean `ORDER BY` ? yeah, it seems to be hard code in Trino-driver.
--
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] [kyuubi] Yikf commented on a diff in pull request #4030: [KYUUBI #4029] Support trino get schemas
Posted by GitBox <gi...@apache.org>.
Yikf commented on code in PR #4030:
URL: https://github.com/apache/kyuubi/pull/4030#discussion_r1057230417
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/trino/api/KyuubiTrinoOperationTranslator.scala:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.server.trino.api
+
+import org.apache.hive.service.rpc.thrift.TProtocolVersion
+
+import org.apache.kyuubi.operation.OperationHandle
+import org.apache.kyuubi.service.BackendService
+import org.apache.kyuubi.session.KyuubiSessionManager
+import org.apache.kyuubi.sql.trino.TrinoGetSchemas
+
+class KyuubiTrinoOperationTranslator(backendService: BackendService) {
+ lazy val parser = backendService.sessionManager.asInstanceOf[KyuubiSessionManager].parser
+
+ def transform(
+ statement: String,
+ user: String,
+ ipAddress: String,
+ configs: Map[String, String]): OperationHandle = {
+ val sessionHandle = backendService.openSession(
+ TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V11,
+ user,
+ "",
+ ipAddress,
+ configs)
+ parser.parsePlan(statement) match {
+ case TrinoGetSchemas(catalogName, schemaPattern) =>
+ backendService.getSchemas(sessionHandle, catalogName, schemaPattern)
+ case _ => throw new UnsupportedOperationException()
Review Comment:
Maybe need to separate the kyuubi trino fe parser file, which only needs case trino compatibility nodes, such as `TrinoGetSchemas`, and `PassThrough` for unmatched syntax, `UnsupportedOperationException` is useless.
Or, make a compatibility node like `TrinoGetSchemas` inherit `KyuubiTrinoFeNode`, translate once `KyuubiTrinoFeNode` is matched, and `PassThrough` all the other nodes. Otherwise SQL like 'KYUUBI SHOW SESSIONS' will throw unsupported exceptions(current parser will parse to TrinoGetSchemas, PassThrough, and RunnableCommand)
--
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] [kyuubi] Yikf commented on a diff in pull request #4030: [KYUUBI #4029] Support trino get schemas
Posted by GitBox <gi...@apache.org>.
Yikf commented on code in PR #4030:
URL: https://github.com/apache/kyuubi/pull/4030#discussion_r1057230417
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/trino/api/KyuubiTrinoOperationTranslator.scala:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.server.trino.api
+
+import org.apache.hive.service.rpc.thrift.TProtocolVersion
+
+import org.apache.kyuubi.operation.OperationHandle
+import org.apache.kyuubi.service.BackendService
+import org.apache.kyuubi.session.KyuubiSessionManager
+import org.apache.kyuubi.sql.trino.TrinoGetSchemas
+
+class KyuubiTrinoOperationTranslator(backendService: BackendService) {
+ lazy val parser = backendService.sessionManager.asInstanceOf[KyuubiSessionManager].parser
+
+ def transform(
+ statement: String,
+ user: String,
+ ipAddress: String,
+ configs: Map[String, String]): OperationHandle = {
+ val sessionHandle = backendService.openSession(
+ TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V11,
+ user,
+ "",
+ ipAddress,
+ configs)
+ parser.parsePlan(statement) match {
+ case TrinoGetSchemas(catalogName, schemaPattern) =>
+ backendService.getSchemas(sessionHandle, catalogName, schemaPattern)
+ case _ => throw new UnsupportedOperationException()
Review Comment:
Maybe need to separate the kyuubi trino fe parser file, which only needs case trino compatibility nodes, such as `TrinoGetSchemas`, and `PassThrough` for unmatched syntax, `UnsupportedOperationException` is useless.
Or, make a compatibility node like `TrinoGetSchemas` inherit `KyuubiTrinoFeNode`, translate once `KyuubiTrinoFeNode` is matched, and `PassThrough` all the other nodes. Otherwise SQL like `KYUUBI SHOW SESSIONS` will throw unsupported exceptions(current parser will parse to TrinoGetSchemas, PassThrough, and RunnableCommand)
--
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] [kyuubi] Yikf commented on pull request #4030: [KYUUBI #4029] Support trino get schemas
Posted by GitBox <gi...@apache.org>.
Yikf commented on PR #4030:
URL: https://github.com/apache/kyuubi/pull/4030#issuecomment-1364930560
Thanks @ulysses-you for working on this, have a few comment have a look plz
--
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] [kyuubi] ulysses-you commented on a diff in pull request #4030: [KYUUBI #4029] Support trino get schemas
Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #4030:
URL: https://github.com/apache/kyuubi/pull/4030#discussion_r1057097534
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/trino/api/KyuubiTrinoOperationTranslator.scala:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.server.trino.api
+
+import org.apache.hive.service.rpc.thrift.TProtocolVersion
+
+import org.apache.kyuubi.operation.OperationHandle
+import org.apache.kyuubi.service.BackendService
+import org.apache.kyuubi.session.KyuubiSessionManager
+import org.apache.kyuubi.sql.trino.TrinoGetSchemas
+
+class KyuubiTrinoOperationTranslator(backendService: BackendService) {
+ lazy val parser = backendService.sessionManager.asInstanceOf[KyuubiSessionManager].parser
+
+ def transform(
+ statement: String,
+ user: String,
+ ipAddress: String,
+ configs: Map[String, String]): OperationHandle = {
+ val sessionHandle = backendService.openSession(
+ TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V11,
+ user,
+ "",
+ ipAddress,
+ configs)
+ parser.parsePlan(statement) match {
+ case TrinoGetSchemas(catalogName, schemaPattern) =>
+ backendService.getSchemas(sessionHandle, catalogName, schemaPattern)
+ case _ => throw new UnsupportedOperationException()
Review Comment:
yes, we should have a PassThrough here
--
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] [kyuubi] ulysses-you commented on a diff in pull request #4030: [KYUUBI #4029] Support trino get schemas
Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #4030:
URL: https://github.com/apache/kyuubi/pull/4030#discussion_r1057097275
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/trino/api/KyuubiTrinoOperationTranslator.scala:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.server.trino.api
+
+import org.apache.hive.service.rpc.thrift.TProtocolVersion
+
+import org.apache.kyuubi.operation.OperationHandle
+import org.apache.kyuubi.service.BackendService
+import org.apache.kyuubi.session.KyuubiSessionManager
+import org.apache.kyuubi.sql.trino.TrinoGetSchemas
+
+class KyuubiTrinoOperationTranslator(backendService: BackendService) {
+ lazy val parser = backendService.sessionManager.asInstanceOf[KyuubiSessionManager].parser
Review Comment:
it does not matter, we can have if necessary. For now, we can work with exists parser file first.
--
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] [kyuubi] Yikf commented on a diff in pull request #4030: [KYUUBI #4029] Support trino get schemas
Posted by GitBox <gi...@apache.org>.
Yikf commented on code in PR #4030:
URL: https://github.com/apache/kyuubi/pull/4030#discussion_r1057091255
##########
kyuubi-server/src/main/antlr4/org/apache/kyuubi/sql/KyuubiSqlBaseParser.g4:
##########
@@ -24,8 +24,11 @@ singleStatement
;
statement
- : (KYUUBI | KYUUBIADMIN) runnableCommand #runnable
- | .*? #passThrough
+ : (KYUUBI | KYUUBIADMIN) runnableCommand #runnable
+ | SELECT TABLE_SCHEM COMMA TABLE_CATALOG FROM SYSTEM_JDBC_SCHEMAS
+ (WHERE (TABLE_CATALOG EQ catalog=STRING+)? AND? (TABLE_SCHEM LIKE schema=STRING+)?)?
+ (ORDER BY TABLE_CATALOG COMMA TABLE_SCHEM)? #getSchemas
Review Comment:
This seems to be a required field
--
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] [kyuubi] Yikf commented on pull request #4030: [KYUUBI #4029] Support trino get schemas
Posted by GitBox <gi...@apache.org>.
Yikf commented on PR #4030:
URL: https://github.com/apache/kyuubi/pull/4030#issuecomment-1365813828
LGTM, except a few comment, make this pr as a base to implement trino fe parser.
--
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] [kyuubi] ulysses-you commented on a diff in pull request #4030: [KYUUBI #4029] Support trino get schemas
Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #4030:
URL: https://github.com/apache/kyuubi/pull/4030#discussion_r1057410825
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/trino/api/KyuubiTrinoOperationTranslator.scala:
##########
@@ -0,0 +1,52 @@
+/*
+ * 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.server.trino.api
+
+import org.apache.hive.service.rpc.thrift.TProtocolVersion
+
+import org.apache.kyuubi.operation.OperationHandle
+import org.apache.kyuubi.service.BackendService
+import org.apache.kyuubi.session.KyuubiSessionManager
+import org.apache.kyuubi.sql.plan.PassThroughNode
+import org.apache.kyuubi.sql.trino.TrinoGetSchemas
+
+class KyuubiTrinoOperationTranslator(backendService: BackendService) {
+ lazy val parser = backendService.sessionManager.asInstanceOf[KyuubiSessionManager].parser
+
+ def transform(
+ statement: String,
+ user: String,
+ ipAddress: String,
+ configs: Map[String, String],
+ runAsync: Boolean,
+ queryTimeout: Long): OperationHandle = {
+ val sessionHandle = backendService.openSession(
+ TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V11,
+ user,
+ "",
+ ipAddress,
+ configs)
Review Comment:
this class is not a operation, more like a helper class to translate statement to a operation. For Trino, each session is a operation, so here we open session and create operation together.
--
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] [kyuubi] ulysses-you commented on pull request #4030: [KYUUBI #4029] Support trino get schemas
Posted by GitBox <gi...@apache.org>.
ulysses-you commented on PR #4030:
URL: https://github.com/apache/kyuubi/pull/4030#issuecomment-1365585320
@Yikf @yaooqinn I separated Trino parser.g4
--
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] [kyuubi] iodone commented on a diff in pull request #4030: [KYUUBI #4029] Support trino get schemas
Posted by GitBox <gi...@apache.org>.
iodone commented on code in PR #4030:
URL: https://github.com/apache/kyuubi/pull/4030#discussion_r1057595360
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/sql/trino/TrinoGetSchemas.scala:
##########
@@ -0,0 +1,32 @@
+/*
+ * 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.trino
+
+import org.apache.kyuubi.sql.plan.KyuubiTreeNode
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// This file contains all Trino JDBC operation nodes which are parsed from statement
Review Comment:
After that, there are GetTable/GetType and other Nodes that need to be parsed, and here the `TrinoGetSchemas.scala` naming is not appropriate
--
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] [kyuubi] ulysses-you commented on pull request #4030: [KYUUBI #4029] Support trino get schemas
Posted by GitBox <gi...@apache.org>.
ulysses-you commented on PR #4030:
URL: https://github.com/apache/kyuubi/pull/4030#issuecomment-1367072823
thanks for review, merging 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] [kyuubi] ulysses-you commented on pull request #4030: [KYUUBI #4029] Support trino get schemas
Posted by GitBox <gi...@apache.org>.
ulysses-you commented on PR #4030:
URL: https://github.com/apache/kyuubi/pull/4030#issuecomment-1364905408
cc @Yikf @iodone @yaooqinn @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] [kyuubi] yaooqinn commented on a diff in pull request #4030: [KYUUBI #4029] Support trino get schemas
Posted by GitBox <gi...@apache.org>.
yaooqinn commented on code in PR #4030:
URL: https://github.com/apache/kyuubi/pull/4030#discussion_r1057399275
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/trino/api/KyuubiTrinoOperationTranslator.scala:
##########
@@ -0,0 +1,52 @@
+/*
+ * 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.server.trino.api
+
+import org.apache.hive.service.rpc.thrift.TProtocolVersion
+
+import org.apache.kyuubi.operation.OperationHandle
+import org.apache.kyuubi.service.BackendService
+import org.apache.kyuubi.session.KyuubiSessionManager
+import org.apache.kyuubi.sql.plan.PassThroughNode
+import org.apache.kyuubi.sql.trino.TrinoGetSchemas
+
+class KyuubiTrinoOperationTranslator(backendService: BackendService) {
+ lazy val parser = backendService.sessionManager.asInstanceOf[KyuubiSessionManager].parser
+
+ def transform(
+ statement: String,
+ user: String,
+ ipAddress: String,
+ configs: Map[String, String],
+ runAsync: Boolean,
+ queryTimeout: Long): OperationHandle = {
+ val sessionHandle = backendService.openSession(
+ TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V11,
+ user,
+ "",
+ ipAddress,
+ configs)
Review Comment:
why open session in operations?
why use hardcode protocol
--
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] [kyuubi] Yikf commented on a diff in pull request #4030: [KYUUBI #4029] Support trino get schemas
Posted by GitBox <gi...@apache.org>.
Yikf commented on code in PR #4030:
URL: https://github.com/apache/kyuubi/pull/4030#discussion_r1057603676
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/trino/api/KyuubiTrinoOperationTranslator.scala:
##########
@@ -0,0 +1,51 @@
+/*
+ * 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.server.trino.api
+
+import org.apache.hive.service.rpc.thrift.TProtocolVersion
+
+import org.apache.kyuubi.operation.OperationHandle
+import org.apache.kyuubi.service.BackendService
+import org.apache.kyuubi.sql.plan.PassThroughNode
+import org.apache.kyuubi.sql.trino.{KyuubiTrinoParser, TrinoGetSchemas}
+
+class KyuubiTrinoOperationTranslator(backendService: BackendService) {
+ lazy val parser = new KyuubiTrinoParser()
+
+ def transform(
+ statement: String,
+ user: String,
+ ipAddress: String,
+ configs: Map[String, String],
+ runAsync: Boolean,
+ queryTimeout: Long): OperationHandle = {
+ val sessionHandle = backendService.openSession(
+ TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V11,
+ user,
+ "",
+ ipAddress,
+ configs)
+ parser.parsePlan(statement) match {
+ case TrinoGetSchemas(catalogName, schemaPattern) =>
+ backendService.getSchemas(sessionHandle, catalogName, schemaPattern)
+ case PassThroughNode() =>
+ backendService.executeStatement(sessionHandle, statement, configs, runAsync, queryTimeout)
+ case _ => throw new UnsupportedOperationException()
Review Comment:
nit, can remove
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/sql/trino/TrinoGetSchemas.scala:
##########
@@ -0,0 +1,32 @@
+/*
+ * 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.trino
+
+import org.apache.kyuubi.sql.plan.KyuubiTreeNode
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// This file contains all Trino JDBC operation nodes which are parsed from statement
+/////////////////////////////////////////////////////////////////////////////////////////
+
+case class PassThrough() extends KyuubiTreeNode {
Review Comment:
Can existing `PassThrough` be reused?
--
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] [kyuubi] ulysses-you commented on a diff in pull request #4030: [KYUUBI #4029] Support trino get schemas
Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #4030:
URL: https://github.com/apache/kyuubi/pull/4030#discussion_r1057097751
##########
kyuubi-server/src/test/scala/org/apache/kyuubi/parser/trino/KyuubiTrinoStatementSuite.scala:
##########
@@ -0,0 +1,68 @@
+/*
+ * 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.parser.trino
+
+import org.apache.kyuubi.KyuubiFunSuite
+import org.apache.kyuubi.sql.parser.KyuubiParser
+import org.apache.kyuubi.sql.trino.TrinoGetSchemas
+
+class KyuubiTrinoStatementSuite extends KyuubiFunSuite {
Review Comment:
sure, it based on Trino jdbc-it
--
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] [kyuubi] ulysses-you commented on a diff in pull request #4030: [KYUUBI #4029] Support trino get schemas
Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #4030:
URL: https://github.com/apache/kyuubi/pull/4030#discussion_r1057097992
##########
kyuubi-server/src/main/antlr4/org/apache/kyuubi/sql/KyuubiSqlBaseParser.g4:
##########
@@ -24,8 +24,11 @@ singleStatement
;
statement
- : (KYUUBI | KYUUBIADMIN) runnableCommand #runnable
- | .*? #passThrough
+ : (KYUUBI | KYUUBIADMIN) runnableCommand #runnable
+ | SELECT TABLE_SCHEM COMMA TABLE_CATALOG FROM SYSTEM_JDBC_SCHEMAS
+ (WHERE (TABLE_CATALOG EQ catalog=STRING+)? AND? (TABLE_SCHEM LIKE schema=STRING+)?)?
+ (ORDER BY TABLE_CATALOG COMMA TABLE_SCHEM)? #getSchemas
Review Comment:
not sure what field you refered ?
--
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] [kyuubi] ulysses-you commented on a diff in pull request #4030: [KYUUBI #4029] Support trino get schemas
Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #4030:
URL: https://github.com/apache/kyuubi/pull/4030#discussion_r1057558419
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/trino/api/KyuubiTrinoOperationTranslator.scala:
##########
@@ -0,0 +1,52 @@
+/*
+ * 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.server.trino.api
+
+import org.apache.hive.service.rpc.thrift.TProtocolVersion
+
+import org.apache.kyuubi.operation.OperationHandle
+import org.apache.kyuubi.service.BackendService
+import org.apache.kyuubi.session.KyuubiSessionManager
+import org.apache.kyuubi.sql.plan.PassThroughNode
+import org.apache.kyuubi.sql.trino.TrinoGetSchemas
+
+class KyuubiTrinoOperationTranslator(backendService: BackendService) {
+ lazy val parser = backendService.sessionManager.asInstanceOf[KyuubiSessionManager].parser
+
+ def transform(
+ statement: String,
+ user: String,
+ ipAddress: String,
+ configs: Map[String, String],
+ runAsync: Boolean,
+ queryTimeout: Long): OperationHandle = {
+ val sessionHandle = backendService.openSession(
+ TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V11,
+ user,
+ "",
+ ipAddress,
+ configs)
Review Comment:
Trino JDBC will send http delete before closing, so we can close it at that time. For other cases, we depend on the Kyuubi timeout machine.
--
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] [kyuubi] ulysses-you closed pull request #4030: [KYUUBI #4029] Support trino get schemas
Posted by GitBox <gi...@apache.org>.
ulysses-you closed pull request #4030: [KYUUBI #4029] Support trino get schemas
URL: https://github.com/apache/kyuubi/pull/4030
--
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] [kyuubi] Yikf commented on a diff in pull request #4030: [KYUUBI #4029] Support trino get schemas
Posted by GitBox <gi...@apache.org>.
Yikf commented on code in PR #4030:
URL: https://github.com/apache/kyuubi/pull/4030#discussion_r1057231283
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/trino/api/KyuubiTrinoOperationTranslator.scala:
##########
@@ -0,0 +1,52 @@
+/*
+ * 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.server.trino.api
+
+import org.apache.hive.service.rpc.thrift.TProtocolVersion
+
+import org.apache.kyuubi.operation.OperationHandle
+import org.apache.kyuubi.service.BackendService
+import org.apache.kyuubi.session.KyuubiSessionManager
+import org.apache.kyuubi.sql.plan.PassThroughNode
+import org.apache.kyuubi.sql.trino.TrinoGetSchemas
+
+class KyuubiTrinoOperationTranslator(backendService: BackendService) {
+ lazy val parser = backendService.sessionManager.asInstanceOf[KyuubiSessionManager].parser
+
+ def transform(
Review Comment:
Method name and class name don't fit well, it's not used for translator, how about TrinoOperationAdapter#executeStatement?
--
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] [kyuubi] yaooqinn commented on a diff in pull request #4030: [KYUUBI #4029] Support trino get schemas
Posted by GitBox <gi...@apache.org>.
yaooqinn commented on code in PR #4030:
URL: https://github.com/apache/kyuubi/pull/4030#discussion_r1057399726
##########
kyuubi-server/src/main/antlr4/org/apache/kyuubi/sql/KyuubiSqlBaseParser.g4:
##########
@@ -24,8 +24,11 @@ singleStatement
;
statement
- : (KYUUBI | KYUUBIADMIN) runnableCommand #runnable
- | .*? #passThrough
+ : (KYUUBI | KYUUBIADMIN) runnableCommand #runnable
+ | SELECT TABLE_SCHEM COMMA TABLE_CATALOG FROM SYSTEM_JDBC_SCHEMAS
Review Comment:
I suggest you create trino parser seperately
--
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