Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-21832][TEST] Merge SQLBuilderTest into ExpressionSQLBuilderSuite #19044

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,29 @@ package org.apache.spark.sql.catalyst

import java.sql.Timestamp

import org.apache.spark.sql.QueryTest
import org.apache.spark.sql.catalyst.dsl.expressions._
import org.apache.spark.sql.catalyst.expressions.{If, Literal, SpecifiedWindowFrame, TimeAdd,
TimeSub, WindowSpecDefinition}
import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.hive.test.TestHiveSingleton
import org.apache.spark.unsafe.types.CalendarInterval

class ExpressionSQLBuilderSuite extends SQLBuilderTest {
class ExpressionSQLBuilderSuite extends QueryTest with TestHiveSingleton {
protected def checkSQL(e: Expression, expectedSQL: String): Unit = {
val actualSQL = e.sql
try {
assert(actualSQL == expectedSQL)
} catch {
case cause: Throwable =>
fail(
s"""Wrong SQL generated for the following expression:
|
|${e.prettyName}
|
|$cause
""".stripMargin)
}
}

test("literal") {
checkSQL(Literal("foo"), "'foo'")
checkSQL(Literal("\"foo\""), "'\"foo\"'")
Expand Down

This file was deleted.