Skip to content

Commit

Permalink
[SPARK-25851][SQL][MINOR] Fix deprecated API warning in SQLListener
Browse files Browse the repository at this point in the history
## What changes were proposed in this pull request?

In #21596, Jackson is upgraded to 2.9.6.
There are some deprecated API warnings in SQLListener.
Create a trivial PR to fix them.

```
[warn] SQLListener.scala:92: method uncheckedSimpleType in class TypeFactory is deprecated: see corresponding Javadoc for more information.
[warn] val objectType = typeFactory.uncheckedSimpleType(classOf[Object])
[warn]
[warn] SQLListener.scala:93: method constructSimpleType in class TypeFactory is deprecated: see corresponding Javadoc for more information.
[warn] typeFactory.constructSimpleType(classOf[(_, _)], classOf[(_, _)], Array(objectType, objectType))
[warn]
[warn] SQLListener.scala:97: method uncheckedSimpleType in class TypeFactory is deprecated: see corresponding Javadoc for more information.
[warn] val longType = typeFactory.uncheckedSimpleType(classOf[Long])
[warn]
[warn] SQLListener.scala:98: method constructSimpleType in class TypeFactory is deprecated: see corresponding Javadoc for more information.
[warn] typeFactory.constructSimpleType(classOf[(_, _)], classOf[(_, _)], Array(longType, longType))
```

## How was this patch tested?

Existing unit tests.

Closes #22848 from gengliangwang/fixSQLListenerWarning.

Authored-by: Gengliang Wang <gengliang.wang@databricks.com>
Signed-off-by: Sean Owen <sean.owen@databricks.com>
  • Loading branch information
gengliangwang authored and srowen committed Oct 26, 2018
1 parent 6aa5063 commit d325ffb
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ private class LongLongTupleConverter extends Converter[(Object, Object), (Long,
}

override def getInputType(typeFactory: TypeFactory): JavaType = {
val objectType = typeFactory.uncheckedSimpleType(classOf[Object])
typeFactory.constructSimpleType(classOf[(_, _)], classOf[(_, _)], Array(objectType, objectType))
val objectType = typeFactory.constructType(classOf[Object])
typeFactory.constructSimpleType(classOf[(_, _)], Array(objectType, objectType))
}

override def getOutputType(typeFactory: TypeFactory): JavaType = {
val longType = typeFactory.uncheckedSimpleType(classOf[Long])
typeFactory.constructSimpleType(classOf[(_, _)], classOf[(_, _)], Array(longType, longType))
val longType = typeFactory.constructType(classOf[Long])
typeFactory.constructSimpleType(classOf[(_, _)], Array(longType, longType))
}
}

0 comments on commit d325ffb

Please sign in to comment.