[
https://issues.apache.org/jira/browse/GOBBLIN-1515?focusedWorklogId=637878&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-637878
]
ASF GitHub Bot logged work on GOBBLIN-1515:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 13/Aug/21 19:41
Start Date: 13/Aug/21 19:41
Worklog Time Spent: 10m
Work Description: ZihanLi58 commented on a change in pull request #3364:
URL: https://github.com/apache/gobblin/pull/3364#discussion_r688741388
##########
File path:
gobblin-hive-registration/src/main/java/org/apache/hadoop/hive/ql/io/orc/TypeDescriptionToObjectInspectorUtil.java
##########
@@ -0,0 +1,443 @@
+/*
+ * 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.hadoop.hive.ql.io.orc;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.hadoop.hive.common.type.HiveDecimal;
+import org.apache.hadoop.hive.serde2.objectinspector.ListObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.MapObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
+import
org.apache.hadoop.hive.serde2.objectinspector.SettableListObjectInspector;
+import
org.apache.hadoop.hive.serde2.objectinspector.SettableMapObjectInspector;
+import
org.apache.hadoop.hive.serde2.objectinspector.SettableStructObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.StructField;
+import org.apache.hadoop.hive.serde2.objectinspector.UnionObjectInspector;
+import
org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory;
+import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory;
+import org.apache.orc.OrcProto;
+import org.apache.orc.OrcUtils;
+import org.apache.orc.TypeDescription;
+
+
+public class TypeDescriptionToObjectInspectorUtil {
+ public static ObjectInspector getObjectInspector(TypeDescription orcSchema) {
+ return createObjectInspector(0, OrcUtils.getOrcTypes(orcSchema));
+ }
+
+ static class Field implements StructField {
+ private final String name;
+ private final ObjectInspector inspector;
+ private final int offset;
+
+ Field(String name, ObjectInspector inspector, int offset) {
+ this.name = name;
+ this.inspector = inspector;
+ this.offset = offset;
+ }
+
+ @Override
+ public String getFieldName() {
+ return name;
+ }
+
+ @Override
+ public ObjectInspector getFieldObjectInspector() {
+ return inspector;
+ }
+
+ @Override
+ public int getFieldID() {
+ return offset;
+ }
+
+ @Override
+ public String getFieldComment() {
+ return null;
+ }
+ }
+
+ static class OrcStructInspector extends SettableStructObjectInspector {
Review comment:
The issue is that by calling OrcUtils.getOrcTypes, we get
org.apache.orc.OrcProto.Type, but OrcStruct.createObjectInspector method only
accept org.apache.hadoop.hive.ql.io.orc.OrcProto.Type, that's why I have to
rewrite this whole class
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 637878)
Time Spent: 2h 20m (was: 2h 10m)
> Fix hive schema not updated issue in streaming and GMIP
> -------------------------------------------------------
>
> Key: GOBBLIN-1515
> URL: https://issues.apache.org/jira/browse/GOBBLIN-1515
> Project: Apache Gobblin
> Issue Type: Bug
> Reporter: Zihan Li
> Priority: Major
> Time Spent: 2h 20m
> Remaining Estimate: 0h
>
> There are two issues need to be fixed:
> 1. Fix the issue that Hive schema is using avro schema even for orc table:
> Now, since we directly use avro schema literal to calculate the column and
> column types for orc table, it sometimes is not correct, so we need to change
> avro schema to orc schema and compute column types accordingly
> 2. Change the behavior that we only evolve avro schema literal but not the
> hive schema when schema evolution happen: In Streaming, when we do hive
> registration, we compare the current schema with schema registry and when
> there is schema evolution, we only update avro schema literal and leave hive
> schema to be lag.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)