You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2021/01/11 21:40:53 UTC

[spark] branch branch-3.1 updated: [SPARK-33970][SQL][TEST][FOLLOWUP] Use String comparision

This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new 9fcd6c0  [SPARK-33970][SQL][TEST][FOLLOWUP] Use String comparision
9fcd6c0 is described below

commit 9fcd6c037fd2c5ec8ea52f22de1ddc4baee7c840
Author: Dongjoon Hyun <dh...@apple.com>
AuthorDate: Mon Jan 11 13:40:03 2021 -0800

    [SPARK-33970][SQL][TEST][FOLLOWUP] Use String comparision
    
    ### What changes were proposed in this pull request?
    
    This is a follow-up to replace `version.toDouble > 2` with `version >= "2.0"`
    
    ### Why are the changes needed?
    
    `toDouble` has some assumption and can cause `java.lang.NumberFormatException`.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Pass the CIs.
    
    Closes #31134 from dongjoon-hyun/SPARK-33970-FOLLOWUP.
    
    Authored-by: Dongjoon Hyun <dh...@apple.com>
    Signed-off-by: Dongjoon Hyun <dh...@apple.com>
    (cherry picked from commit 3556929c43881831f25c28c7dfc1999310f96232)
    Signed-off-by: Dongjoon Hyun <dh...@apple.com>
---
 .../org/apache/spark/sql/hive/client/HivePartitionFilteringSuite.scala  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HivePartitionFilteringSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HivePartitionFilteringSuite.scala
index fd83395..ebab105 100644
--- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HivePartitionFilteringSuite.scala
+++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HivePartitionFilteringSuite.scala
@@ -41,7 +41,7 @@ class HivePartitionFilteringSuite(version: String)
   private val tryDirectSqlKey = HiveConf.ConfVars.METASTORE_TRY_DIRECT_SQL.varname
 
   // Support default partition in metastoredirectsql since HIVE-11898(Hive 2.0.0).
-  private val defaultPartition = if (version.toDouble >= 2) Some(DEFAULT_PARTITION_NAME) else None
+  private val defaultPartition = if (version >= "2.0") Some(DEFAULT_PARTITION_NAME) else None
 
   private val dsValue = 20170101 to 20170103
   private val hValue = 0 to 4


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org