[
https://issues.apache.org/jira/browse/TAJO-1359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14532779#comment-14532779
]
ASF GitHub Bot commented on TAJO-1359:
--------------------------------------
Github user jihoonson commented on a diff in the pull request:
https://github.com/apache/tajo/pull/422#discussion_r29857765
--- Diff:
tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/NestedPathUtil.java
---
@@ -0,0 +1,109 @@
+/**
+ * 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.tajo.catalog;
+
+import com.google.common.base.Preconditions;
+import org.apache.tajo.common.TajoDataTypes.Type;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Utility methods for nested field
+ */
+public class NestedPathUtil {
+ public static final String PATH_DELIMITER = "/";
+
+ public static final List<String> ROOT_PATH =
Collections.unmodifiableList(new ArrayList<String>());
+
+ public static boolean isPath(String name) {
+ return name.indexOf(PATH_DELIMITER.charAt(0)) >= 0;
+ }
+
+ public static String make(String [] parts) {
+ return make(parts, 0);
+ }
+
+ public static String make(String [] parts, int startIndex) {
+ return make(parts, startIndex, parts.length);
+ }
+
+ /**
+ * Make a nested field path
+ *
+ * @param parts path parts
+ * @param startIndex startIndex
+ * @param depth Depth
+ * @return Path
+ */
+ public static String make(String [] parts, int startIndex, int depth) {
--- End diff --
It would be nice if the method name is more intuitive.
> Add nested field projector and language extension to project nested record
> --------------------------------------------------------------------------
>
> Key: TAJO-1359
> URL: https://issues.apache.org/jira/browse/TAJO-1359
> Project: Tajo
> Issue Type: Sub-task
> Components: parser, physical operator, planner/optimizer
> Reporter: Hyunsik Choi
> Assignee: Hyunsik Choi
> Fix For: 0.11.0
>
> Attachments: TAJO-1359.patch, TAJO-1359_2.patch, TAJO-1359_3.patch,
> TAJO-1359_4.patch, TAJO-1359_5.patch, TAJO-1359_6.patch, TAJO-1359_7.patch
>
>
> We need to improve Projector class to get nested record fields, and we also
> add some language extension to specify certain nested records in table
> schema. Both works should be done together. Otherwise, we need to test an
> entire work process.
> Using dot '.' would be good for the syntax to specify nested fields. Many
> systems (Hive, Google BigQuery, and Drill) already use this syntax. Probably,
> many users are familiar with this form.
> For example, if *employee* is a root nested record field and it includes
> *age* and *name* fields, consisting two fields lastname and firstname, we can
> specify them individually as follows:
> {code}
> SELECT employee.age, employee.name.lastname, employee.name.firstname FROM ...
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)