Skip to content

Commit 219805a

Browse files
committed
style
1 parent 5b93711 commit 219805a

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,17 @@ abstract class LogicalPlan extends QueryPlan[LogicalPlan] {
101101
val options = input.flatMap { option =>
102102
// If the first part of the desired name matches a qualifier for this possible match, drop it.
103103
val remainingParts =
104-
if (option.qualifiers.filter(resolver(_, parts.head)).nonEmpty && parts.size > 1) parts.drop(1) else parts
105-
if (resolver(option.name, remainingParts.head)) (option, remainingParts.tail.toList) :: Nil else Nil
104+
if (option.qualifiers.filter(resolver(_, parts.head)).nonEmpty && parts.size > 1) {
105+
parts.drop(1)
106+
} else {
107+
parts
108+
}
109+
110+
if (resolver(option.name, remainingParts.head)) {
111+
(option, remainingParts.tail.toList) :: Nil
112+
} else {
113+
Nil
114+
}
106115
}
107116

108117
options.distinct match {

sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUdfs.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ private[hive] abstract class HiveFunctionRegistry
4242
def lookupFunction(name: String, children: Seq[Expression]): Expression = {
4343
// We only look it up to see if it exists, but do not include it in the HiveUDF since it is
4444
// not always serializable.
45-
val functionInfo: FunctionInfo = Option(FunctionRegistry.getFunctionInfo(name.toLowerCase)).getOrElse(
46-
sys.error(s"Couldn't find function $name"))
45+
val functionInfo: FunctionInfo =
46+
Option(FunctionRegistry.getFunctionInfo(name.toLowerCase)).getOrElse(
47+
sys.error(s"Couldn't find function $name"))
4748

4849
val functionClassName = functionInfo.getFunctionClass.getName
4950

0 commit comments

Comments
 (0)