org.apache.iceberg.orc.IdToOrcName Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of iceberg-orc Show documentation
Show all versions of iceberg-orc Show documentation
A table format for huge analytic datasets
/*
* 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.iceberg.orc;
import java.util.Deque;
import java.util.List;
import java.util.Map;
import org.apache.iceberg.Schema;
import org.apache.iceberg.relocated.com.google.common.base.Joiner;
import org.apache.iceberg.relocated.com.google.common.collect.Iterables;
import org.apache.iceberg.relocated.com.google.common.collect.Lists;
import org.apache.iceberg.relocated.com.google.common.collect.Maps;
import org.apache.iceberg.types.Type;
import org.apache.iceberg.types.TypeUtil;
import org.apache.iceberg.types.Types;
/**
* Generates mapping from field IDs to ORC qualified names.
*
* This visitor also enclose column names in backticks i.e. ` so that ORC can correctly parse
* column names with special characters. A comparison of ORC convention with Iceberg convention is
* provided below
*
*
{@code
* Iceberg ORC
* field field field
* struct -> field struct.field struct.field
* list -> element list.element list._elem
* list -> struct element -> field list.field list._elem.field
* map -> key map.key map._key
* map -> value map.value map._value
* map -> struct key -> field map.key.field map._key.field
* map -> struct value -> field map.field map._value.field
* }
*/
class IdToOrcName extends TypeUtil.SchemaVisitor
© 2015 - 2025 Weber Informatics LLC | Privacy Policy