Github user JoshRosen commented on a diff in the pull request:
https://github.com/apache/spark/pull/3429#discussion_r22092047
--- Diff:
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveInspectors.scala ---
@@ -119,12 +269,44 @@ private[hive] trait HiveInspectors {
System.arraycopy(writable.getBytes, 0, temp, 0, temp.length)
temp
case poi: WritableConstantDateObjectInspector =>
poi.getWritableConstantValue.get()
- case hvoi: HiveVarcharObjectInspector =>
hvoi.getPrimitiveJavaObject(data).getValue
- case hdoi: HiveDecimalObjectInspector =>
HiveShim.toCatalystDecimal(hdoi, data)
- // org.apache.hadoop.hive.serde2.io.TimestampWritable.set will reset
current time object
- // if next timestamp is null, so Timestamp object is cloned
- case ti: TimestampObjectInspector =>
ti.getPrimitiveJavaObject(data).clone()
- case pi: PrimitiveObjectInspector => pi.getPrimitiveJavaObject(data)
+ case mi: StandardConstantMapObjectInspector =>
+ // take the value from the map inspector object, rather than the
input data
+ mi.getWritableConstantValue.map { case (k, v) =>
+ (unwrap(k, mi.getMapKeyObjectInspector),
+ unwrap(v, mi.getMapValueObjectInspector))
+ }.toMap
+ case li: StandardConstantListObjectInspector =>
+ // take the value from the list inspector object, rather than the
input data
+ li.getWritableConstantValue.map(unwrap(_,
li.getListElementObjectInspector)).toSeq
+ // if the value is null, we don't care about the object inspector type
+ case _ if data == null => null
+ case poi: VoidObjectInspector => null // always be null for void
object inspector
+ case pi: PrimitiveObjectInspector => pi match {
+ // We think HiveVarchar is also a String
+ case hvoi: HiveVarcharObjectInspector if hvoi.preferWritable() =>
+ hvoi.getPrimitiveWritableObject(data).getHiveVarchar.getValue
+ case hvoi: HiveVarcharObjectInspector =>
hvoi.getPrimitiveJavaObject(data).getValue
+ case x: StringObjectInspector if x.preferWritable() =>
+ x.getPrimitiveWritableObject(data).toString
+ case x: IntObjectInspector if x.preferWritable() => x.get(data)
+ case x: BooleanObjectInspector if x.preferWritable() => x.get(data)
+ case x: FloatObjectInspector if x.preferWritable() => x.get(data)
+ case x: DoubleObjectInspector if x.preferWritable() => x.get(data)
+ case x: LongObjectInspector if x.preferWritable() => x.get(data)
+ case x: ShortObjectInspector if x.preferWritable() => x.get(data)
+ case x: ByteObjectInspector if x.preferWritable() => x.get(data)
+ case x: HiveDecimalObjectInspector => HiveShim.toCatalystDecimal(x,
data)
+ case x: BinaryObjectInspector if x.preferWritable() =>
+ x.getPrimitiveWritableObject(data).copyBytes()
--- End diff --
It looks like this PR may have caused a build break for the hadoop1.0
profile:
https://amplab.cs.berkeley.edu/jenkins/job/Spark-Master-SBT/1245/AMPLAB_JENKINS_BUILD_PROFILE=hadoop1.0,label=centos/
```
[warn] Note: Recompile with -Xlint:unchecked for details.
[info] Compiling 21 Scala sources and 1 Java source to
/home/jenkins/workspace/Spark-Master-SBT/AMPLAB_JENKINS_BUILD_PROFILE/hadoop1.0/label/centos/sql/hive/target/scala-2.10/classes...
[error]
/home/jenkins/workspace/Spark-Master-SBT/AMPLAB_JENKINS_BUILD_PROFILE/hadoop1.0/label/centos/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveInspectors.scala:300:
value copyBytes is not a member of org.apache.hadoop.io.BytesWritable
[error] x.getPrimitiveWritableObject(data).copyBytes()
[error] ^
[error] one error found
[error] (hive/compile:compile) Compilation failed
[error] Total time: 117 s, completed Dec 18, 2014 8:51:43 PM
[error] Got a return code of 1 on line 155 of the run-tests script.
Build step 'Execute shell' marked build as failure
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]