Skip to content

Commit

Permalink
Prevent returning internal compiler expressions when compiling UDFs (#…
Browse files Browse the repository at this point in the history
…9190)

Signed-off-by: Jason Lowe <jlowe@nvidia.com>
  • Loading branch information
jlowe authored Sep 6, 2023
1 parent eed3f3f commit cdf5433
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2022, NVIDIA CORPORATION.
* Copyright (c) 2019-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -90,7 +90,13 @@ case class CatalystExpressionBuilder(private val function: AnyRef) extends Loggi
if (compiled.isEmpty) {
logDebug(s"[CatalystExpressionBuilder] failed to compile")
} else {
logDebug(s"[CatalystExpressionBuilder] compiled expression: ${compiled.get.toString}")
val expr = compiled.get
val internal = expr.find(_.isInstanceOf[Repr.CompilerInternal])
internal.foreach { e =>
throw new IllegalStateException(
s"compiled UDF has compiler internal expression $e: $expr")
}
logDebug(s"[CatalystExpressionBuilder] compiled expression: $expr")
}

compiled
Expand Down

0 comments on commit cdf5433

Please sign in to comment.