JingsongLi commented on a change in pull request #9971: [FLINK-14490][table] 
Add methods for interacting with temporary objects
URL: https://github.com/apache/flink/pull/9971#discussion_r339392857
 
 

 ##########
 File path: 
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/api/internal/TableEnvImpl.scala
 ##########
 @@ -363,15 +371,26 @@ abstract class TableEnvImpl(
 
   @throws[TableException]
   override def scan(tablePath: String*): Table = {
-    scanInternal(tablePath.toArray) match {
+    val unresolvedIdentifier = UnresolvedIdentifier.of(tablePath: _*)
+    scanInternal(unresolvedIdentifier) match {
       case Some(table) => createTable(table)
       case None => throw new TableException(s"Table 
'${tablePath.mkString(".")}' was not found.")
     }
   }
 
-  private[flink] def scanInternal(tablePath: Array[String]): 
Option[CatalogQueryOperation] = {
-    val unresolvedIdentifier = UnresolvedIdentifier.of(tablePath: _*)
-    val objectIdentifier = 
catalogManager.qualifyIdentifier(unresolvedIdentifier)
+  override def from(path: String): Table = {
+    val parser = planningConfigurationBuilder.createCalciteParser()
+    val unresolvedIdentifier = 
UnresolvedIdentifier.of(parser.parseIdentifier(path).names: _*)
+    scanInternal(unresolvedIdentifier) match {
+      case Some(table) => createTable(table)
+      case None => throw new TableException(s"Table '$path' was not found.")
 
 Review comment:
   Can we have a unify exception message? Use `unresolvedIdentifier`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to