pengxiangyu commented on code in PR #15418:
URL: https://github.com/apache/doris/pull/15418#discussion_r1058792961


##########
fe/fe-core/src/main/cup/sql_parser.cup:
##########
@@ -5095,9 +5098,31 @@ base_table_ref_list ::=
   ;
 
 base_table_ref ::=
-    table_name:name opt_partition_names:partitionNames 
opt_tablet_list:tabletIds opt_table_alias:alias opt_table_sample:tableSample 
opt_common_hints:commonHints
+    table_name:name opt_snapshot_version:snapshotVersion 
opt_partition_names:partitionNames opt_tablet_list:tabletIds 
opt_table_alias:alias opt_table_sample:tableSample opt_common_hints:commonHints
     {:
-        RESULT = new TableRef(name, alias, partitionNames, tabletIds, 
tableSample, commonHints);
+        RESULT = new TableRef(name, alias, partitionNames, tabletIds, 
tableSample, commonHints, snapshotVersion);
+    :}
+    ;
+
+opt_snapshot_version ::=
+    /* empty */
+    {:
+        RESULT = null;
+    :}
+    | snapshot_version:snapshotVersion
+    {:
+        RESULT = snapshotVersion;
+    :}
+    ;
+
+snapshot_version ::=

Review Comment:
   external_table_snapshot is better, it contains not only version, but also 
time,



##########
fe/fe-core/src/main/java/org/apache/doris/analysis/BaseTableRef.java:
##########
@@ -70,6 +70,7 @@ public void analyze(Analyzer analyzer) throws UserException {
         name.analyze(analyzer);
         desc = analyzer.registerTableRef(this);
         isAnalyzed = true;  // true that we have assigned desc
+        analyzeSnapshotVersion(analyzer);

Review Comment:
   It is better to be analyzeExternalTable(analyzer), 
analyzeSnapshotVersion(analyzer) is better in this function.
   So that you can deal with all external table options in this function in the 
furture.



##########
fe/fe-core/src/main/java/org/apache/doris/analysis/SnapshotVersion.java:
##########
@@ -0,0 +1,66 @@
+// 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.doris.analysis;
+
+public class SnapshotVersion {

Review Comment:
   May be ExternalTableSnapshot is better, it doesn't only contain version, but 
also time.



##########
fe/fe-core/src/main/java/org/apache/doris/analysis/SnapshotVersion.java:
##########
@@ -0,0 +1,66 @@
+// 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.doris.analysis;

Review Comment:
   package org.apache.doris.analysis.external;
   external table has more syntax, it will be too many in package: 
org.apache.doris.analysis



-- 
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: commits-unsubscr...@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to