[GitHub] [spark] viirya commented on a change in pull request #30162: [SPARK-33263][SS] Configurable StateStore compression codec

2020-10-28 Thread GitBox


viirya commented on a change in pull request #30162:
URL: https://github.com/apache/spark/pull/30162#discussion_r513897382



##
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateStoreCompatibilitySuite.scala
##
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.execution.streaming.state
+
+import java.io.File
+
+import org.apache.commons.io.FileUtils
+
+import org.apache.spark.SparkFunSuite
+import org.apache.spark.io.CompressionCodec
+import org.apache.spark.sql.catalyst.plans.PlanTestBase
+import org.apache.spark.sql.catalyst.streaming.InternalOutputModes.Update
+import org.apache.spark.sql.execution.streaming.MemoryStream
+import org.apache.spark.sql.functions.count
+import org.apache.spark.sql.internal.SQLConf
+import org.apache.spark.sql.streaming.StreamTest
+import org.apache.spark.util.Utils
+
+class StateStoreCompatibleSuite extends StreamTest with StateStoreCodecsTest {

Review comment:
   Oops!





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] [spark] viirya commented on a change in pull request #30162: [SPARK-33263][SS] Configurable StateStore compression codec

2020-10-28 Thread GitBox


viirya commented on a change in pull request #30162:
URL: https://github.com/apache/spark/pull/30162#discussion_r513835420



##
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
##
@@ -1324,6 +1324,16 @@ object SQLConf {
 .intConf
 .createWithDefault(2)
 
+  val STATE_STORE_COMPRESSION_CODEC =
+buildConf("spark.sql.streaming.stateStore.compression.codec")
+  .internal()
+  .doc("The codec used to compress delta and snapshot files generated by 
StateStore. " +
+"By default, Spark provides four codecs: lz4, lzf, snappy, and zstd. 
You can also " +
+"use fully qualified class names to specify the codec. Default codec 
is lz4.")

Review comment:
   For invalid codec name, `CompressionCodec.createCodec` will throw an 
`IllegalArgumentException`.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] [spark] viirya commented on a change in pull request #30162: [SPARK-33263][SS] Configurable StateStore compression codec

2020-10-28 Thread GitBox


viirya commented on a change in pull request #30162:
URL: https://github.com/apache/spark/pull/30162#discussion_r513833642



##
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateStoreSuite.scala
##
@@ -814,11 +818,53 @@ class StateStoreSuite extends 
StateStoreSuiteBase[HDFSBackedStateStoreProvider]
   }
 }
 
+class StateStoreCompatibleSuite extends StreamTest with StateStoreCodecsTest {

Review comment:
   Sure.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] [spark] viirya commented on a change in pull request #30162: [SPARK-33263][SS] Configurable StateStore compression codec

2020-10-28 Thread GitBox


viirya commented on a change in pull request #30162:
URL: https://github.com/apache/spark/pull/30162#discussion_r513831661



##
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
##
@@ -1324,6 +1324,16 @@ object SQLConf {
 .intConf
 .createWithDefault(2)
 
+  val STATE_STORE_COMPRESSION_CODEC =
+buildConf("spark.sql.streaming.stateStore.compression.codec")
+  .internal()
+  .doc("The codec used to compress delta and snapshot files generated by 
StateStore. " +
+"By default, Spark provides four codecs: lz4, lzf, snappy, and zstd. 
You can also " +
+"use fully qualified class names to specify the codec. Default codec 
is lz4.")

Review comment:
   Okay.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] [spark] viirya commented on a change in pull request #30162: [SPARK-33263][SS] Configurable StateStore compression codec

2020-10-28 Thread GitBox


viirya commented on a change in pull request #30162:
URL: https://github.com/apache/spark/pull/30162#discussion_r513203243



##
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/OffsetSeq.scala
##
@@ -89,10 +89,15 @@ case class OffsetSeqMetadata(
 
 object OffsetSeqMetadata extends Logging {
   private implicit val format = Serialization.formats(NoTypeHints)
+  /**
+   * These configs are related to streaming query execution and should not be 
changed across
+   * batches of a streaming query. The values of these configs are persisted 
into the offset
+   * log in the checkpoint position.
+   */
   private val relevantSQLConfs = Seq(
 SHUFFLE_PARTITIONS, STATE_STORE_PROVIDER_CLASS, 
STREAMING_MULTIPLE_WATERMARK_POLICY,
 FLATMAPGROUPSWITHSTATE_STATE_FORMAT_VERSION, 
STREAMING_AGGREGATION_STATE_FORMAT_VERSION,
-STREAMING_JOIN_STATE_FORMAT_VERSION)
+STREAMING_JOIN_STATE_FORMAT_VERSION, STATE_STORE_COMPRESSION_CODEC)

Review comment:
   Seems good if we possibly change default value unintentionally in the 
future.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] [spark] viirya commented on a change in pull request #30162: [SPARK-33263][SS] Configurable StateStore compression codec

2020-10-27 Thread GitBox


viirya commented on a change in pull request #30162:
URL: https://github.com/apache/spark/pull/30162#discussion_r513177486



##
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/OffsetSeq.scala
##
@@ -89,10 +89,15 @@ case class OffsetSeqMetadata(
 
 object OffsetSeqMetadata extends Logging {
   private implicit val format = Serialization.formats(NoTypeHints)
+  /**
+   * These configs are related to streaming query execution and should not be 
changed across
+   * batches of a streaming query. The values of these configs are persisted 
into the offset
+   * log in the checkpoint position.
+   */

Review comment:
   Added some comments to notify readers.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org