Skip to content
Snippets Groups Projects
  1. Sep 07, 2017
    • Dongjoon Hyun's avatar
      [SPARK-21939][TEST] Use TimeLimits instead of Timeouts · c26976fe
      Dongjoon Hyun authored
      Since ScalaTest 3.0.0, `org.scalatest.concurrent.Timeouts` is deprecated.
      This PR replaces the deprecated one with `org.scalatest.concurrent.TimeLimits`.
      
      ```scala
      -import org.scalatest.concurrent.Timeouts._
      +import org.scalatest.concurrent.TimeLimits._
      ```
      
      Pass the existing test suites.
      
      Author: Dongjoon Hyun <dongjoon@apache.org>
      
      Closes #19150 from dongjoon-hyun/SPARK-21939.
      
      Change-Id: I1a1b07f1b97e51e2263dfb34b7eaaa099b2ded5e
      c26976fe
    • Dongjoon Hyun's avatar
      [SPARK-21912][SQL] ORC/Parquet table should not create invalid column names · eea2b877
      Dongjoon Hyun authored
      ## What changes were proposed in this pull request?
      
      Currently, users meet job abortions while creating or altering ORC/Parquet tables with invalid column names. We had better prevent this by raising **AnalysisException** with a guide to use aliases instead like Paquet data source tables.
      
      **BEFORE**
      ```scala
      scala> sql("CREATE TABLE orc1 USING ORC AS SELECT 1 `a b`")
      17/09/04 13:28:21 ERROR Utils: Aborting task
      java.lang.IllegalArgumentException: Error: : expected at the position 8 of 'struct<a b:int>' but ' ' is found.
      17/09/04 13:28:21 ERROR FileFormatWriter: Job job_20170904132821_0001 aborted.
      17/09/04 13:28:21 ERROR Executor: Exception in task 0.0 in stage 1.0 (TID 1)
      org.apache.spark.SparkException: Task failed while writing rows.
      ```
      
      **AFTER**
      ```scala
      scala> sql("CREATE TABLE orc1 USING ORC AS SELECT 1 `a b`")
      17/09/04 13:27:40 ERROR CreateDataSourceTableAsSelectCommand: Failed to write to table orc1
      org.apache.spark.sql.AnalysisException: Attribute name "a b" contains invalid character(s) among " ,;{}()\n\t=". Please use alias to rename it.;
      ```
      
      ## How was this patch tested?
      
      Pass the Jenkins with a new test case.
      
      Author: Dongjoon Hyun <dongjoon@apache.org>
      
      Closes #19124 from dongjoon-hyun/SPARK-21912.
      eea2b877
    • Liang-Chi Hsieh's avatar
      [SPARK-21835][SQL][FOLLOW-UP] RewritePredicateSubquery should not produce unresolved query plans · ce7293c1
      Liang-Chi Hsieh authored
      ## What changes were proposed in this pull request?
      
      This is a follow-up of #19050 to deal with `ExistenceJoin` case.
      
      ## How was this patch tested?
      
      Added test.
      
      Author: Liang-Chi Hsieh <viirya@gmail.com>
      
      Closes #19151 from viirya/SPARK-21835-followup.
      ce7293c1
  2. Sep 06, 2017
    • Jacek Laskowski's avatar
      [SPARK-21901][SS] Define toString for StateOperatorProgress · fa0092bd
      Jacek Laskowski authored
      ## What changes were proposed in this pull request?
      
      Just `StateOperatorProgress.toString` + few formatting fixes
      
      ## How was this patch tested?
      
      Local build. Waiting for OK from Jenkins.
      
      Author: Jacek Laskowski <jacek@japila.pl>
      
      Closes #19112 from jaceklaskowski/SPARK-21901-StateOperatorProgress-toString.
      fa0092bd
    • Jose Torres's avatar
      [SPARK-21765] Check that optimization doesn't affect isStreaming bit. · acdf45fb
      Jose Torres authored
      ## What changes were proposed in this pull request?
      
      Add an assert in logical plan optimization that the isStreaming bit stays the same, and fix empty relation rules where that wasn't happening.
      
      ## How was this patch tested?
      
      new and existing unit tests
      
      Author: Jose Torres <joseph.torres@databricks.com>
      Author: Jose Torres <joseph-torres@databricks.com>
      
      Closes #19056 from joseph-torres/SPARK-21765-followup.
      acdf45fb
    • Liang-Chi Hsieh's avatar
      [SPARK-21835][SQL] RewritePredicateSubquery should not produce unresolved query plans · f2e22aeb
      Liang-Chi Hsieh authored
      ## What changes were proposed in this pull request?
      
      Correlated predicate subqueries are rewritten into `Join` by the rule `RewritePredicateSubquery`  during optimization.
      
      It is possibly that the two sides of the `Join` have conflicting attributes. The query plans produced by `RewritePredicateSubquery` become unresolved and break structural integrity.
      
      We should check if there are conflicting attributes in the `Join` and de-duplicate them by adding a `Project`.
      
      ## How was this patch tested?
      
      Added tests.
      
      Author: Liang-Chi Hsieh <viirya@gmail.com>
      
      Closes #19050 from viirya/SPARK-21835.
      f2e22aeb
  3. Sep 05, 2017
    • Xingbo Jiang's avatar
      [SPARK-21652][SQL] Fix rule confliction between InferFiltersFromConstraints and ConstantPropagation · fd60d4fa
      Xingbo Jiang authored
      ## What changes were proposed in this pull request?
      
      For the given example below, the predicate added by `InferFiltersFromConstraints` is folded by `ConstantPropagation` later, this leads to unconverged optimize iteration:
      ```
      Seq((1, 1)).toDF("col1", "col2").createOrReplaceTempView("t1")
      Seq(1, 2).toDF("col").createOrReplaceTempView("t2")
      sql("SELECT * FROM t1, t2 WHERE t1.col1 = 1 AND 1 = t1.col2 AND t1.col1 = t2.col AND t1.col2 = t2.col")
      ```
      
      We can fix this by adjusting the indent of the optimize rules.
      
      ## How was this patch tested?
      
      Add test case that would have failed in `SQLQuerySuite`.
      
      Author: Xingbo Jiang <xingbo.jiang@databricks.com>
      
      Closes #19099 from jiangxb1987/unconverge-optimization.
      fd60d4fa
    • gatorsmile's avatar
      [SPARK-21845][SQL][TEST-MAVEN] Make codegen fallback of expressions configurable · 2974406d
      gatorsmile authored
      ## What changes were proposed in this pull request?
      We should make codegen fallback of expressions configurable. So far, it is always on. We might hide it when our codegen have compilation bugs. Thus, we should also disable the codegen fallback when running test cases.
      
      ## How was this patch tested?
      Added test cases
      
      Author: gatorsmile <gatorsmile@gmail.com>
      
      Closes #19119 from gatorsmile/fallbackCodegen.
      2974406d
    • hyukjinkwon's avatar
      [SPARK-20978][SQL] Bump up Univocity version to 2.5.4 · 02a4386a
      hyukjinkwon authored
      ## What changes were proposed in this pull request?
      
      There was a bug in Univocity Parser that causes the issue in SPARK-20978. This was fixed as below:
      
      ```scala
      val df = spark.read.schema("a string, b string, unparsed string").option("columnNameOfCorruptRecord", "unparsed").csv(Seq("a").toDS())
      df.show()
      ```
      
      **Before**
      
      ```
      java.lang.NullPointerException
      	at scala.collection.immutable.StringLike$class.stripLineEnd(StringLike.scala:89)
      	at scala.collection.immutable.StringOps.stripLineEnd(StringOps.scala:29)
      	at org.apache.spark.sql.execution.datasources.csv.UnivocityParser.org$apache$spark$sql$execution$datasources$csv$UnivocityParser$$getCurrentInput(UnivocityParser.scala:56)
      	at org.apache.spark.sql.execution.datasources.csv.UnivocityParser$$anonfun$org$apache$spark$sql$execution$datasources$csv$UnivocityParser$$convert$1.apply(UnivocityParser.scala:207)
      	at org.apache.spark.sql.execution.datasources.csv.UnivocityParser$$anonfun$org$apache$spark$sql$execution$datasources$csv$UnivocityParser$$convert$1.apply(UnivocityParser.scala:207)
      ...
      ```
      
      **After**
      
      ```
      +---+----+--------+
      |  a|   b|unparsed|
      +---+----+--------+
      |  a|null|       a|
      +---+----+--------+
      ```
      
      It was fixed in 2.5.0 and 2.5.4 was released. I guess it'd be safe to upgrade this.
      
      ## How was this patch tested?
      
      Unit test added in `CSVSuite.scala`.
      
      Author: hyukjinkwon <gurwls223@gmail.com>
      
      Closes #19113 from HyukjinKwon/bump-up-univocity.
      02a4386a
    • Dongjoon Hyun's avatar
      [SPARK-21913][SQL][TEST] withDatabase` should drop database with CASCADE · 4e7a29ef
      Dongjoon Hyun authored
      ## What changes were proposed in this pull request?
      
      Currently, `withDatabase` fails if the database is not empty. It would be great if we drop cleanly with CASCADE.
      
      ## How was this patch tested?
      
      This is a change on test util. Pass the existing Jenkins.
      
      Author: Dongjoon Hyun <dongjoon@apache.org>
      
      Closes #19125 from dongjoon-hyun/SPARK-21913.
      4e7a29ef
  4. Sep 04, 2017
    • Sean Owen's avatar
      [SPARK-21418][SQL] NoSuchElementException: None.get in DataSourceScanExec with... · ca59445a
      Sean Owen authored
      [SPARK-21418][SQL] NoSuchElementException: None.get in DataSourceScanExec with sun.io.serialization.extendedDebugInfo=true
      
      ## What changes were proposed in this pull request?
      
      If no SparkConf is available to Utils.redact, simply don't redact.
      
      ## How was this patch tested?
      
      Existing tests
      
      Author: Sean Owen <sowen@cloudera.com>
      
      Closes #19123 from srowen/SPARK-21418.
      ca59445a
  5. Sep 03, 2017
    • Liang-Chi Hsieh's avatar
      [SPARK-21654][SQL] Complement SQL predicates expression description · 9f30d928
      Liang-Chi Hsieh authored
      ## What changes were proposed in this pull request?
      
      SQL predicates don't have complete expression description. This patch goes to complement the description by adding arguments, examples.
      
      This change also adds related test cases for the SQL predicate expressions.
      
      ## How was this patch tested?
      
      Existing tests. And added predicate test.
      
      Author: Liang-Chi Hsieh <viirya@gmail.com>
      
      Closes #18869 from viirya/SPARK-21654.
      9f30d928
  6. Sep 02, 2017
    • gatorsmile's avatar
      [SPARK-21891][SQL] Add TBLPROPERTIES to DDL statement: CREATE TABLE USING · acb7fed2
      gatorsmile authored
      ## What changes were proposed in this pull request?
      Add `TBLPROPERTIES` to the DDL statement `CREATE TABLE USING`.
      
      After this change, the DDL becomes
      ```
      CREATE [TEMPORARY] TABLE [IF NOT EXISTS] [db_name.]table_name
      USING table_provider
      [OPTIONS table_property_list]
      [PARTITIONED BY (col_name, col_name, ...)]
      [CLUSTERED BY (col_name, col_name, ...)
       [SORTED BY (col_name [ASC|DESC], ...)]
       INTO num_buckets BUCKETS
      ]
      [LOCATION path]
      [COMMENT table_comment]
      [TBLPROPERTIES (property_name=property_value, ...)]
      [[AS] select_statement];
      ```
      
      ## How was this patch tested?
      Add a few tests
      
      Author: gatorsmile <gatorsmile@gmail.com>
      
      Closes #19100 from gatorsmile/addTablePropsToCreateTableUsing.
      acb7fed2
  7. Sep 01, 2017
    • Sean Owen's avatar
      [SPARK-14280][BUILD][WIP] Update change-version.sh and pom.xml to add Scala... · 12ab7f7e
      Sean Owen authored
      [SPARK-14280][BUILD][WIP] Update change-version.sh and pom.xml to add Scala 2.12 profiles and enable 2.12 compilation
      
      …build; fix some things that will be warnings or errors in 2.12; restore Scala 2.12 profile infrastructure
      
      ## What changes were proposed in this pull request?
      
      This change adds back the infrastructure for a Scala 2.12 build, but does not enable it in the release or Python test scripts.
      
      In order to make that meaningful, it also resolves compile errors that the code hits in 2.12 only, in a way that still works with 2.11.
      
      It also updates dependencies to the earliest minor release of dependencies whose current version does not yet support Scala 2.12. This is in a sense covered by other JIRAs under the main umbrella, but implemented here. The versions below still work with 2.11, and are the _latest_ maintenance release in the _earliest_ viable minor release.
      
      - Scalatest 2.x -> 3.0.3
      - Chill 0.8.0 -> 0.8.4
      - Clapper 1.0.x -> 1.1.2
      - json4s 3.2.x -> 3.4.2
      - Jackson 2.6.x -> 2.7.9 (required by json4s)
      
      This change does _not_ fully enable a Scala 2.12 build:
      
      - It will also require dropping support for Kafka before 0.10. Easy enough, just didn't do it yet here
      - It will require recreating `SparkILoop` and `Main` for REPL 2.12, which is SPARK-14650. Possible to do here too.
      
      What it does do is make changes that resolve much of the remaining gap without affecting the current 2.11 build.
      
      ## How was this patch tested?
      
      Existing tests and build. Manually tested with `./dev/change-scala-version.sh 2.12` to verify it compiles, modulo the exceptions above.
      
      Author: Sean Owen <sowen@cloudera.com>
      
      Closes #18645 from srowen/SPARK-14280.
      12ab7f7e
    • he.qiao's avatar
      [SPARK-21880][WEB UI] In the SQL table page, modify jobs trace information · 12f0d242
      he.qiao authored
      ## What changes were proposed in this pull request?
      As shown below, for example, When the job 5 is running, It was a mistake to think that five jobs were running, So I think it would be more appropriate to change jobs to job id.
      ![image](https://user-images.githubusercontent.com/21355020/29909612-4dc85064-8e59-11e7-87cd-275a869243bb.png)
      
      ## How was this patch tested?
      no need
      
      Author: he.qiao <he.qiao17@zte.com.cn>
      
      Closes #19093 from Geek-He/08_31_sqltable.
      12f0d242
  8. Aug 31, 2017
    • hyukjinkwon's avatar
      [SPARK-21779][PYTHON] Simpler DataFrame.sample API in Python · 5cd8ea99
      hyukjinkwon authored
      ## What changes were proposed in this pull request?
      
      This PR make `DataFrame.sample(...)` can omit `withReplacement` defaulting `False`, consistently with equivalent Scala / Java API.
      
      In short, the following examples are allowed:
      
      ```python
      >>> df = spark.range(10)
      >>> df.sample(0.5).count()
      7
      >>> df.sample(fraction=0.5).count()
      3
      >>> df.sample(0.5, seed=42).count()
      5
      >>> df.sample(fraction=0.5, seed=42).count()
      5
      ```
      
      In addition, this PR also adds some type checking logics as below:
      
      ```python
      >>> df = spark.range(10)
      >>> df.sample().count()
      ...
      TypeError: withReplacement (optional), fraction (required) and seed (optional) should be a bool, float and number; however, got [].
      >>> df.sample(True).count()
      ...
      TypeError: withReplacement (optional), fraction (required) and seed (optional) should be a bool, float and number; however, got [<type 'bool'>].
      >>> df.sample(42).count()
      ...
      TypeError: withReplacement (optional), fraction (required) and seed (optional) should be a bool, float and number; however, got [<type 'int'>].
      >>> df.sample(fraction=False, seed="a").count()
      ...
      TypeError: withReplacement (optional), fraction (required) and seed (optional) should be a bool, float and number; however, got [<type 'bool'>, <type 'str'>].
      >>> df.sample(seed=[1]).count()
      ...
      TypeError: withReplacement (optional), fraction (required) and seed (optional) should be a bool, float and number; however, got [<type 'list'>].
      >>> df.sample(withReplacement="a", fraction=0.5, seed=1)
      ...
      TypeError: withReplacement (optional), fraction (required) and seed (optional) should be a bool, float and number; however, got [<type 'str'>, <type 'float'>, <type 'int'>].
      ```
      
      ## How was this patch tested?
      
      Manually tested, unit tests added in doc tests and manually checked the built documentation for Python.
      
      Author: hyukjinkwon <gurwls223@gmail.com>
      
      Closes #18999 from HyukjinKwon/SPARK-21779.
      5cd8ea99
    • Bryan Cutler's avatar
      [SPARK-21583][HOTFIX] Removed intercept in test causing failures · 501370d9
      Bryan Cutler authored
      Removing a check in the ColumnarBatchSuite that depended on a Java assertion.  This assertion is being compiled out in the Maven builds causing the test to fail.  This part of the test is not specifically from to the functionality that is being tested here.
      
      Author: Bryan Cutler <cutlerb@gmail.com>
      
      Closes #19098 from BryanCutler/hotfix-ColumnarBatchSuite-assertion.
      501370d9
    • Jacek Laskowski's avatar
      [SPARK-21886][SQL] Use SparkSession.internalCreateDataFrame to create… · 9696580c
      Jacek Laskowski authored
      … Dataset with LogicalRDD logical operator
      
      ## What changes were proposed in this pull request?
      
      Reusing `SparkSession.internalCreateDataFrame` wherever possible (to cut dups)
      
      ## How was this patch tested?
      
      Local build and waiting for Jenkins
      
      Author: Jacek Laskowski <jacek@japila.pl>
      
      Closes #19095 from jaceklaskowski/SPARK-21886-internalCreateDataFrame.
      9696580c
    • gatorsmile's avatar
      [SPARK-21878][SQL][TEST] Create SQLMetricsTestUtils · 19b0240d
      gatorsmile authored
      ## What changes were proposed in this pull request?
      Creates `SQLMetricsTestUtils` for the utility functions of both Hive-specific and the other SQLMetrics test cases.
      
      Also, move two SQLMetrics test cases from sql/hive to sql/core.
      
      ## How was this patch tested?
      N/A
      
      Author: gatorsmile <gatorsmile@gmail.com>
      
      Closes #19092 from gatorsmile/rewriteSQLMetrics.
      19b0240d
  9. Aug 30, 2017
    • Bryan Cutler's avatar
      [SPARK-21583][SQL] Create a ColumnarBatch from ArrowColumnVectors · 964b507c
      Bryan Cutler authored
      ## What changes were proposed in this pull request?
      
      This PR allows the creation of a `ColumnarBatch` from `ReadOnlyColumnVectors` where previously a columnar batch could only allocate vectors internally.  This is useful for using `ArrowColumnVectors` in a batch form to do row-based iteration.  Also added `ArrowConverter.fromPayloadIterator` which converts `ArrowPayload` iterator to `InternalRow` iterator and uses a `ColumnarBatch` internally.
      
      ## How was this patch tested?
      
      Added a new unit test for creating a `ColumnarBatch` with `ReadOnlyColumnVectors` and a test to verify the roundtrip of rows -> ArrowPayload -> rows, using `toPayloadIterator` and `fromPayloadIterator`.
      
      Author: Bryan Cutler <cutlerb@gmail.com>
      
      Closes #18787 from BryanCutler/arrow-ColumnarBatch-support-SPARK-21583.
      964b507c
    • Andrew Ash's avatar
      [SPARK-21875][BUILD] Fix Java style bugs · 313c6ca4
      Andrew Ash authored
      ## What changes were proposed in this pull request?
      
      Fix Java code style so `./dev/lint-java` succeeds
      
      ## How was this patch tested?
      
      Run `./dev/lint-java`
      
      Author: Andrew Ash <andrew@andrewash.com>
      
      Closes #19088 from ash211/spark-21875-lint-java.
      313c6ca4
    • Dongjoon Hyun's avatar
      [SPARK-21839][SQL] Support SQL config for ORC compression · d8f45408
      Dongjoon Hyun authored
      ## What changes were proposed in this pull request?
      
      This PR aims to support `spark.sql.orc.compression.codec` like Parquet's `spark.sql.parquet.compression.codec`. Users can use SQLConf to control ORC compression, too.
      
      ## How was this patch tested?
      
      Pass the Jenkins with new and updated test cases.
      
      Author: Dongjoon Hyun <dongjoon@apache.org>
      
      Closes #19055 from dongjoon-hyun/SPARK-21839.
      d8f45408
    • caoxuewen's avatar
      [MINOR][SQL][TEST] Test shuffle hash join while is not expected · 235d2833
      caoxuewen authored
      ## What changes were proposed in this pull request?
      
      igore("shuffle hash join") is to shuffle hash join to test _case class ShuffledHashJoinExec_.
      But when you 'ignore' -> 'test', the test is _case class BroadcastHashJoinExec_.
      
      Before modified,  as a result of:canBroadcast is true.
      Print information in _canBroadcast(plan: LogicalPlan)_
      ```
      canBroadcast plan.stats.sizeInBytes:6710880
      canBroadcast conf.autoBroadcastJoinThreshold:10000000
      ```
      
      After modified, plan.stats.sizeInBytes is 11184808.
      Print information in _canBuildLocalHashMap(plan: LogicalPlan)_
      and _muchSmaller(a: LogicalPlan, b: LogicalPlan)_ :
      
      ```
      canBuildLocalHashMap plan.stats.sizeInBytes:11184808
      canBuildLocalHashMap conf.autoBroadcastJoinThreshold:10000000
      canBuildLocalHashMap conf.numShufflePartitions:2
      ```
      ```
      muchSmaller a.stats.sizeInBytes * 3:33554424
      muchSmaller b.stats.sizeInBytes:33554432
      ```
      ## How was this patch tested?
      
      existing test case.
      
      Author: caoxuewen <cao.xuewen@zte.com.cn>
      
      Closes #19069 from heary-cao/shuffle_hash_join.
      235d2833
    • gatorsmile's avatar
      32d6d9d7
  10. Aug 29, 2017
    • gatorsmile's avatar
      [SPARK-21845][SQL] Make codegen fallback of expressions configurable · 3d0e1742
      gatorsmile authored
      ## What changes were proposed in this pull request?
      We should make codegen fallback of expressions configurable. So far, it is always on. We might hide it when our codegen have compilation bugs. Thus, we should also disable the codegen fallback when running test cases.
      
      ## How was this patch tested?
      Added test cases
      
      Author: gatorsmile <gatorsmile@gmail.com>
      
      Closes #19062 from gatorsmile/fallbackCodegen.
      3d0e1742
    • Wenchen Fan's avatar
      [SPARK-21255][SQL] simplify encoder for java enum · 6327ea57
      Wenchen Fan authored
      ## What changes were proposed in this pull request?
      
      This is a follow-up for https://github.com/apache/spark/pull/18488, to simplify the code.
      
      The major change is, we should map java enum to string type, instead of a struct type with a single string field.
      
      ## How was this patch tested?
      
      existing tests
      
      Author: Wenchen Fan <wenchen@databricks.com>
      
      Closes #19066 from cloud-fan/fix.
      6327ea57
    • Wang Gengliang's avatar
      [SPARK-21848][SQL] Add trait UserDefinedExpression to identify user-defined functions · 8fcbda9c
      Wang Gengliang authored
      ## What changes were proposed in this pull request?
      
      Add trait UserDefinedExpression to identify user-defined functions.
      UDF can be expensive. In optimizer we may need to avoid executing UDF multiple times.
      E.g.
      ```scala
      table.select(UDF as 'a).select('a, ('a + 1) as 'b)
      ```
      If UDF is expensive in this case, optimizer should not collapse the project to
      ```scala
      table.select(UDF as 'a, (UDF+1) as 'b)
      ```
      
      Currently UDF classes like PythonUDF, HiveGenericUDF are not defined in catalyst.
      This PR is to add a new trait to make it easier to identify user-defined functions.
      
      ## How was this patch tested?
      
      Unit test
      
      Author: Wang Gengliang <ltnwgl@gmail.com>
      
      Closes #19064 from gengliangwang/UDFType.
      8fcbda9c
    • Takuya UESHIN's avatar
      [SPARK-21781][SQL] Modify DataSourceScanExec to use concrete ColumnVector type. · 32fa0b81
      Takuya UESHIN authored
      ## What changes were proposed in this pull request?
      
      As mentioned at https://github.com/apache/spark/pull/18680#issuecomment-316820409, when we have more `ColumnVector` implementations, it might (or might not) have huge performance implications because it might disable inlining, or force virtual dispatches.
      
      As for read path, one of the major paths is the one generated by `ColumnBatchScan`. Currently it refers `ColumnVector` so the penalty will be bigger as we have more classes, but we can know the concrete type from its usage, e.g. vectorized Parquet reader uses `OnHeapColumnVector`. We can use the concrete type in the generated code directly to avoid the penalty.
      
      ## How was this patch tested?
      
      Existing tests.
      
      Author: Takuya UESHIN <ueshin@databricks.com>
      
      Closes #18989 from ueshin/issues/SPARK-21781.
      32fa0b81
  11. Aug 27, 2017
  12. Aug 25, 2017
    • Sean Owen's avatar
      [SPARK-21837][SQL][TESTS] UserDefinedTypeSuite Local UDTs not actually testing what it intends · 1a598d71
      Sean Owen authored
      ## What changes were proposed in this pull request?
      
      Adjust Local UDTs test to assert about results, and fix index of vector column. See JIRA for details.
      
      ## How was this patch tested?
      
      Existing tests.
      
      Author: Sean Owen <sowen@cloudera.com>
      
      Closes #19053 from srowen/SPARK-21837.
      1a598d71
    • vinodkc's avatar
      [SPARK-21756][SQL] Add JSON option to allow unquoted control characters · 51620e28
      vinodkc authored
      ## What changes were proposed in this pull request?
      
      This patch adds allowUnquotedControlChars option in JSON data source to allow JSON Strings to contain unquoted control characters (ASCII characters with value less than 32, including tab and line feed characters)
      
      ## How was this patch tested?
      Add new test cases
      
      Author: vinodkc <vinod.kc.in@gmail.com>
      
      Closes #19008 from vinodkc/br_fix_SPARK-21756.
      51620e28
    • Sean Owen's avatar
      [MINOR][BUILD] Fix build warnings and Java lint errors · de7af295
      Sean Owen authored
      ## What changes were proposed in this pull request?
      
      Fix build warnings and Java lint errors. This just helps a bit in evaluating (new) warnings in another PR I have open.
      
      ## How was this patch tested?
      
      Existing tests
      
      Author: Sean Owen <sowen@cloudera.com>
      
      Closes #19051 from srowen/JavaWarnings.
      de7af295
    • mike's avatar
      [SPARK-21255][SQL][WIP] Fixed NPE when creating encoder for enum · 7d16776d
      mike authored
      ## What changes were proposed in this pull request?
      
      Fixed NPE when creating encoder for enum.
      
      When you try to create an encoder for Enum type (or bean with enum property) via Encoders.bean(...), it fails with NullPointerException at TypeToken:495.
      I did a little research and it turns out, that in JavaTypeInference following code
      ```
        def getJavaBeanReadableProperties(beanClass: Class[_]): Array[PropertyDescriptor] = {
          val beanInfo = Introspector.getBeanInfo(beanClass)
          beanInfo.getPropertyDescriptors.filterNot(_.getName == "class")
            .filter(_.getReadMethod != null)
        }
      ```
      filters out properties named "class", because we wouldn't want to serialize that. But enum types have another property of type Class named "declaringClass", which we are trying to inspect recursively. Eventually we try to inspect ClassLoader class, which has property "defaultAssertionStatus" with no read method, which leads to NPE at TypeToken:495.
      
      I added property name "declaringClass" to filtering to resolve this.
      
      ## How was this patch tested?
      Unit test in JavaDatasetSuite which creates an encoder for enum
      
      Author: mike <mike0sv@gmail.com>
      Author: Mikhail Sveshnikov <mike0sv@gmail.com>
      
      Closes #18488 from mike0sv/enum-support.
      7d16776d
  13. Aug 24, 2017
    • Herman van Hovell's avatar
      [SPARK-21830][SQL] Bump ANTLR version and fix a few issues. · 05af2de0
      Herman van Hovell authored
      ## What changes were proposed in this pull request?
      This PR bumps the ANTLR version to 4.7, and fixes a number of small parser related issues uncovered by the bump.
      
      The main reason for upgrading is that in some cases the current version of ANTLR (4.5) can exhibit exponential slowdowns if it needs to parse boolean predicates. For example the following query will take forever to parse:
      ```sql
      SELECT *
      FROM RANGE(1000)
      WHERE
      TRUE
      AND NOT upper(DESCRIPTION) LIKE '%FOO%'
      AND NOT upper(DESCRIPTION) LIKE '%FOO%'
      AND NOT upper(DESCRIPTION) LIKE '%FOO%'
      AND NOT upper(DESCRIPTION) LIKE '%FOO%'
      AND NOT upper(DESCRIPTION) LIKE '%FOO%'
      AND NOT upper(DESCRIPTION) LIKE '%FOO%'
      AND NOT upper(DESCRIPTION) LIKE '%FOO%'
      AND NOT upper(DESCRIPTION) LIKE '%FOO%'
      AND NOT upper(DESCRIPTION) LIKE '%FOO%'
      AND NOT upper(DESCRIPTION) LIKE '%FOO%'
      AND NOT upper(DESCRIPTION) LIKE '%FOO%'
      AND NOT upper(DESCRIPTION) LIKE '%FOO%'
      AND NOT upper(DESCRIPTION) LIKE '%FOO%'
      AND NOT upper(DESCRIPTION) LIKE '%FOO%'
      AND NOT upper(DESCRIPTION) LIKE '%FOO%'
      AND NOT upper(DESCRIPTION) LIKE '%FOO%'
      AND NOT upper(DESCRIPTION) LIKE '%FOO%'
      AND NOT upper(DESCRIPTION) LIKE '%FOO%'
      ```
      
      This is caused by a know bug in ANTLR (https://github.com/antlr/antlr4/issues/994), which was fixed in version 4.6.
      
      ## How was this patch tested?
      Existing tests.
      
      Author: Herman van Hovell <hvanhovell@databricks.com>
      
      Closes #19042 from hvanhovell/SPARK-21830.
      05af2de0
    • Shixiong Zhu's avatar
      [SPARK-21788][SS] Handle more exceptions when stopping a streaming query · d3abb369
      Shixiong Zhu authored
      ## What changes were proposed in this pull request?
      
      Add more cases we should view as a normal query stop rather than a failure.
      
      ## How was this patch tested?
      
      The new unit tests.
      
      Author: Shixiong Zhu <zsxwing@gmail.com>
      
      Closes #18997 from zsxwing/SPARK-21788.
      d3abb369
    • Wenchen Fan's avatar
      [SPARK-21826][SQL] outer broadcast hash join should not throw NPE · 2dd37d82
      Wenchen Fan authored
      ## What changes were proposed in this pull request?
      
      This is a bug introduced by https://github.com/apache/spark/pull/11274/files#diff-7adb688cbfa583b5711801f196a074bbL274 .
      
      Non-equal join condition should only be applied when the equal-join condition matches.
      
      ## How was this patch tested?
      
      regression test
      
      Author: Wenchen Fan <wenchen@databricks.com>
      
      Closes #19036 from cloud-fan/bug.
      2dd37d82
    • Liang-Chi Hsieh's avatar
      [SPARK-21759][SQL] In.checkInputDataTypes should not wrongly report unresolved... · 183d4cb7
      Liang-Chi Hsieh authored
      [SPARK-21759][SQL] In.checkInputDataTypes should not wrongly report unresolved plans for IN correlated subquery
      
      ## What changes were proposed in this pull request?
      
      With the check for structural integrity proposed in SPARK-21726, it is found that the optimization rule `PullupCorrelatedPredicates` can produce unresolved plans.
      
      For a correlated IN query looks like:
      
          SELECT t1.a FROM t1
          WHERE
          t1.a IN (SELECT t2.c
                  FROM t2
                  WHERE t1.b < t2.d);
      
      The query plan might look like:
      
          Project [a#0]
          +- Filter a#0 IN (list#4 [b#1])
             :  +- Project [c#2]
             :     +- Filter (outer(b#1) < d#3)
             :        +- LocalRelation <empty>, [c#2, d#3]
             +- LocalRelation <empty>, [a#0, b#1]
      
      After `PullupCorrelatedPredicates`, it produces query plan like:
      
          'Project [a#0]
          +- 'Filter a#0 IN (list#4 [(b#1 < d#3)])
             :  +- Project [c#2, d#3]
             :     +- LocalRelation <empty>, [c#2, d#3]
             +- LocalRelation <empty>, [a#0, b#1]
      
      Because the correlated predicate involves another attribute `d#3` in subquery, it has been pulled out and added into the `Project` on the top of the subquery.
      
      When `list` in `In` contains just one `ListQuery`, `In.checkInputDataTypes` checks if the size of `value` expressions matches the output size of subquery. In the above example, there is only `value` expression and the subquery output has two attributes `c#2, d#3`, so it fails the check and `In.resolved` returns `false`.
      
      We should not let `In.checkInputDataTypes` wrongly report unresolved plans to fail the structural integrity check.
      
      ## How was this patch tested?
      
      Added test.
      
      Author: Liang-Chi Hsieh <viirya@gmail.com>
      
      Closes #18968 from viirya/SPARK-21759.
      183d4cb7
    • Takuya UESHIN's avatar
      [SPARK-21745][SQL] Refactor ColumnVector hierarchy to make ColumnVector... · 9e33954d
      Takuya UESHIN authored
      [SPARK-21745][SQL] Refactor ColumnVector hierarchy to make ColumnVector read-only and to introduce WritableColumnVector.
      
      ## What changes were proposed in this pull request?
      
      This is a refactoring of `ColumnVector` hierarchy and related classes.
      
      1. make `ColumnVector` read-only
      2. introduce `WritableColumnVector` with write interface
      3. remove `ReadOnlyColumnVector`
      
      ## How was this patch tested?
      
      Existing tests.
      
      Author: Takuya UESHIN <ueshin@databricks.com>
      
      Closes #18958 from ueshin/issues/SPARK-21745.
      9e33954d
    • lufei's avatar
      [MINOR][SQL] The comment of Class ExchangeCoordinator exist a typing and context error · 846bc61c
      lufei authored
      ## What changes were proposed in this pull request?
      
      The given example in the comment of Class ExchangeCoordinator is exist four post-shuffle partitions,but the current comment is “three”.
      
      ## How was this patch tested?
      
      Author: lufei <lu.fei80@zte.com.cn>
      
      Closes #19028 from figo77/SPARK-21816.
      846bc61c
  14. Aug 22, 2017
    • Jose Torres's avatar
      [SPARK-21765] Set isStreaming on leaf nodes for streaming plans. · 3c0c2d09
      Jose Torres authored
      ## What changes were proposed in this pull request?
      All streaming logical plans will now have isStreaming set. This involved adding isStreaming as a case class arg in a few cases, since a node might be logically streaming depending on where it came from.
      
      ## How was this patch tested?
      
      Existing unit tests - no functional change is intended in this PR.
      
      Author: Jose Torres <joseph-torres@databricks.com>
      Author: Tathagata Das <tathagata.das1565@gmail.com>
      
      Closes #18973 from joseph-torres/SPARK-21765.
      3c0c2d09
Loading