You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2023/01/06 01:14:09 UTC
[GitHub] [spark] gengliangwang opened a new pull request, #39416: Revert "[SPARK-41677][CORE][SQL][SS][UI] Add Protobuf serializer for StreamingQueryProgressWrapper"
gengliangwang opened a new pull request, #39416:
URL: https://github.com/apache/spark/pull/39416
### What changes were proposed in this pull request?
<!--
Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
2. If you fix some SQL features, you can provide some references of other DBMSes.
3. If there is design documentation, please add the link.
4. If there is a discussion in the mailing list, please add the link.
-->
This reverts commit 915e9c67a9581a1f66e70321879092d854c9fb3b.
### Why are the changes needed?
<!--
Please clarify why the changes are needed. For instance,
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, you can clarify why it is a bug.
-->
When running end-to-end tests, there are 5 NPE errors from string fields:
- SourceProgress.latestOffset
- SourceProgress.endOffset
- SourceProgress.startOffset
- StreamingQueryData.name
- StreamingQueryProgress.name
After fixing them, there is following error:
```
java.lang.UnsupportedOperationException
at java.base/java.util.Collections$UnmodifiableMap.remove(Collections.java:1460)
at org.apache.spark.sql.streaming.ui.StreamingQueryStatisticsPage.$anonfun$generateStatTable$27(StreamingQueryStatisticsPage.scala:401)
```
The deserialized map `StreamingQueryProgress.durationMs` needs to be mutable.
Give the StreamingQueryProgressWrapper contains nullable fields and mutable map, I suggest using the default JSON serailizer for this class.
### Does this PR introduce _any_ user-facing change?
<!--
Note that it means *any* user-facing change including all aspects such as the documentation fix.
If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
If no, write 'No'.
-->
No
### How was this patch tested?
<!--
If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
-->
GA tests
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] gengliangwang commented on pull request #39416: Revert "[SPARK-41677][CORE][SQL][SS][UI] Add Protobuf serializer for StreamingQueryProgressWrapper"
Posted by GitBox <gi...@apache.org>.
gengliangwang commented on PR #39416:
URL: https://github.com/apache/spark/pull/39416#issuecomment-1373007545
cc @LuciferYang @techaddict @panbingkun
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on a diff in pull request #39416: Revert "[SPARK-41677][CORE][SQL][SS][UI] Add Protobuf serializer for StreamingQueryProgressWrapper"
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #39416:
URL: https://github.com/apache/spark/pull/39416#discussion_r1063053660
##########
sql/core/src/main/scala/org/apache/spark/status/protobuf/sql/StreamingQueryProgressSerializer.scala:
##########
@@ -1,89 +0,0 @@
-/*
- * 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.status.protobuf.sql
-
-import java.util.{HashMap => JHashMap, Map => JMap, UUID}
-
-import com.fasterxml.jackson.databind.json.JsonMapper
-import com.fasterxml.jackson.module.scala.DefaultScalaModule
-
-import org.apache.spark.sql.Row
-import org.apache.spark.sql.catalyst.expressions.GenericRowWithSchema
-import org.apache.spark.sql.streaming.StreamingQueryProgress
-import org.apache.spark.status.protobuf.StoreTypes
-
-private[protobuf] object StreamingQueryProgressSerializer {
-
- private val mapper: JsonMapper = JsonMapper.builder()
- .addModule(DefaultScalaModule)
- .build()
-
- def serialize(process: StreamingQueryProgress): StoreTypes.StreamingQueryProgress = {
- val builder = StoreTypes.StreamingQueryProgress.newBuilder()
- builder.setId(process.id.toString)
- builder.setRunId(process.runId.toString)
- builder.setName(process.name)
- builder.setTimestamp(process.timestamp)
- builder.setBatchId(process.batchId)
- builder.setBatchDuration(process.batchDuration)
- process.durationMs.forEach {
- case (k, v) => builder.putDurationMs(k, v)
- }
- process.eventTime.forEach {
- case (k, v) => builder.putEventTime(k, v)
- }
- process.stateOperators.foreach(
- s => builder.addStateOperators(StateOperatorProgressSerializer.serialize(s)))
- process.sources.foreach(
- s => builder.addSources(SourceProgressSerializer.serialize(s))
- )
- builder.setSink(SinkProgressSerializer.serialize(process.sink))
- process.observedMetrics.forEach {
- case (k, v) => builder.putObservedMetrics(k, mapper.writeValueAsString(v))
- }
- builder.build()
- }
-
- def deserialize(process: StoreTypes.StreamingQueryProgress): StreamingQueryProgress = {
- new StreamingQueryProgress(
- id = UUID.fromString(process.getId),
- runId = UUID.fromString(process.getRunId),
- name = process.getName,
- timestamp = process.getTimestamp,
- batchId = process.getBatchId,
- batchDuration = process.getBatchDuration,
- durationMs = process.getDurationMsMap,
Review Comment:
How about change line 70 to
```
durationMs = new JHashMap(process.getDurationMsMap)
```
then `UISeleniumWithRocksDBBackendSuite` can pass. What are we worried about? The change performance is poor? Or worry about other problems?
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] gengliangwang commented on a diff in pull request #39416: Revert "[SPARK-41677][CORE][SQL][SS][UI] Add Protobuf serializer for StreamingQueryProgressWrapper"
Posted by GitBox <gi...@apache.org>.
gengliangwang commented on code in PR #39416:
URL: https://github.com/apache/spark/pull/39416#discussion_r1063058600
##########
sql/core/src/main/scala/org/apache/spark/status/protobuf/sql/StreamingQueryProgressSerializer.scala:
##########
@@ -1,89 +0,0 @@
-/*
- * 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.status.protobuf.sql
-
-import java.util.{HashMap => JHashMap, Map => JMap, UUID}
-
-import com.fasterxml.jackson.databind.json.JsonMapper
-import com.fasterxml.jackson.module.scala.DefaultScalaModule
-
-import org.apache.spark.sql.Row
-import org.apache.spark.sql.catalyst.expressions.GenericRowWithSchema
-import org.apache.spark.sql.streaming.StreamingQueryProgress
-import org.apache.spark.status.protobuf.StoreTypes
-
-private[protobuf] object StreamingQueryProgressSerializer {
-
- private val mapper: JsonMapper = JsonMapper.builder()
- .addModule(DefaultScalaModule)
- .build()
-
- def serialize(process: StreamingQueryProgress): StoreTypes.StreamingQueryProgress = {
- val builder = StoreTypes.StreamingQueryProgress.newBuilder()
- builder.setId(process.id.toString)
- builder.setRunId(process.runId.toString)
- builder.setName(process.name)
- builder.setTimestamp(process.timestamp)
- builder.setBatchId(process.batchId)
- builder.setBatchDuration(process.batchDuration)
- process.durationMs.forEach {
- case (k, v) => builder.putDurationMs(k, v)
- }
- process.eventTime.forEach {
- case (k, v) => builder.putEventTime(k, v)
- }
- process.stateOperators.foreach(
- s => builder.addStateOperators(StateOperatorProgressSerializer.serialize(s)))
- process.sources.foreach(
- s => builder.addSources(SourceProgressSerializer.serialize(s))
- )
- builder.setSink(SinkProgressSerializer.serialize(process.sink))
- process.observedMetrics.forEach {
- case (k, v) => builder.putObservedMetrics(k, mapper.writeValueAsString(v))
- }
- builder.build()
- }
-
- def deserialize(process: StoreTypes.StreamingQueryProgress): StreamingQueryProgress = {
- new StreamingQueryProgress(
- id = UUID.fromString(process.getId),
- runId = UUID.fromString(process.getRunId),
- name = process.getName,
- timestamp = process.getTimestamp,
- batchId = process.getBatchId,
- batchDuration = process.getBatchDuration,
- durationMs = process.getDurationMsMap,
Review Comment:
There are 4 `ju.map` in the whole object..and for the string fields some of them are nullable...
I feel that it is risky for this one.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] gengliangwang commented on pull request #39416: Revert "[SPARK-41677][CORE][SQL][SS][UI] Add Protobuf serializer for StreamingQueryProgressWrapper"
Posted by GitBox <gi...@apache.org>.
gengliangwang commented on PR #39416:
URL: https://github.com/apache/spark/pull/39416#issuecomment-1373036752
@dongjoon-hyun yes it is
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] gengliangwang commented on pull request #39416: Revert "[SPARK-41677][CORE][SQL][SS][UI] Add Protobuf serializer for StreamingQueryProgressWrapper"
Posted by GitBox <gi...@apache.org>.
gengliangwang commented on PR #39416:
URL: https://github.com/apache/spark/pull/39416#issuecomment-1373007875
I am running end-to-end tests from https://github.com/apache/spark/pull/39415
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] gengliangwang commented on a diff in pull request #39416: Revert "[SPARK-41677][CORE][SQL][SS][UI] Add Protobuf serializer for StreamingQueryProgressWrapper"
Posted by GitBox <gi...@apache.org>.
gengliangwang commented on code in PR #39416:
URL: https://github.com/apache/spark/pull/39416#discussion_r1063059215
##########
sql/core/src/main/scala/org/apache/spark/status/protobuf/sql/StreamingQueryProgressSerializer.scala:
##########
@@ -1,89 +0,0 @@
-/*
- * 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.status.protobuf.sql
-
-import java.util.{HashMap => JHashMap, Map => JMap, UUID}
-
-import com.fasterxml.jackson.databind.json.JsonMapper
-import com.fasterxml.jackson.module.scala.DefaultScalaModule
-
-import org.apache.spark.sql.Row
-import org.apache.spark.sql.catalyst.expressions.GenericRowWithSchema
-import org.apache.spark.sql.streaming.StreamingQueryProgress
-import org.apache.spark.status.protobuf.StoreTypes
-
-private[protobuf] object StreamingQueryProgressSerializer {
-
- private val mapper: JsonMapper = JsonMapper.builder()
- .addModule(DefaultScalaModule)
- .build()
-
- def serialize(process: StreamingQueryProgress): StoreTypes.StreamingQueryProgress = {
- val builder = StoreTypes.StreamingQueryProgress.newBuilder()
- builder.setId(process.id.toString)
- builder.setRunId(process.runId.toString)
- builder.setName(process.name)
- builder.setTimestamp(process.timestamp)
- builder.setBatchId(process.batchId)
- builder.setBatchDuration(process.batchDuration)
- process.durationMs.forEach {
- case (k, v) => builder.putDurationMs(k, v)
- }
- process.eventTime.forEach {
- case (k, v) => builder.putEventTime(k, v)
- }
- process.stateOperators.foreach(
- s => builder.addStateOperators(StateOperatorProgressSerializer.serialize(s)))
- process.sources.foreach(
- s => builder.addSources(SourceProgressSerializer.serialize(s))
- )
- builder.setSink(SinkProgressSerializer.serialize(process.sink))
- process.observedMetrics.forEach {
- case (k, v) => builder.putObservedMetrics(k, mapper.writeValueAsString(v))
- }
- builder.build()
- }
-
- def deserialize(process: StoreTypes.StreamingQueryProgress): StreamingQueryProgress = {
- new StreamingQueryProgress(
- id = UUID.fromString(process.getId),
- runId = UUID.fromString(process.getRunId),
- name = process.getName,
- timestamp = process.getTimestamp,
- batchId = process.getBatchId,
- batchDuration = process.getBatchDuration,
- durationMs = process.getDurationMsMap,
Review Comment:
@LuciferYang If you are confident about this one. Feel free to add the serializer again after the tests are merged
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on a diff in pull request #39416: Revert "[SPARK-41677][CORE][SQL][SS][UI] Add Protobuf serializer for StreamingQueryProgressWrapper"
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #39416:
URL: https://github.com/apache/spark/pull/39416#discussion_r1063053660
##########
sql/core/src/main/scala/org/apache/spark/status/protobuf/sql/StreamingQueryProgressSerializer.scala:
##########
@@ -1,89 +0,0 @@
-/*
- * 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.status.protobuf.sql
-
-import java.util.{HashMap => JHashMap, Map => JMap, UUID}
-
-import com.fasterxml.jackson.databind.json.JsonMapper
-import com.fasterxml.jackson.module.scala.DefaultScalaModule
-
-import org.apache.spark.sql.Row
-import org.apache.spark.sql.catalyst.expressions.GenericRowWithSchema
-import org.apache.spark.sql.streaming.StreamingQueryProgress
-import org.apache.spark.status.protobuf.StoreTypes
-
-private[protobuf] object StreamingQueryProgressSerializer {
-
- private val mapper: JsonMapper = JsonMapper.builder()
- .addModule(DefaultScalaModule)
- .build()
-
- def serialize(process: StreamingQueryProgress): StoreTypes.StreamingQueryProgress = {
- val builder = StoreTypes.StreamingQueryProgress.newBuilder()
- builder.setId(process.id.toString)
- builder.setRunId(process.runId.toString)
- builder.setName(process.name)
- builder.setTimestamp(process.timestamp)
- builder.setBatchId(process.batchId)
- builder.setBatchDuration(process.batchDuration)
- process.durationMs.forEach {
- case (k, v) => builder.putDurationMs(k, v)
- }
- process.eventTime.forEach {
- case (k, v) => builder.putEventTime(k, v)
- }
- process.stateOperators.foreach(
- s => builder.addStateOperators(StateOperatorProgressSerializer.serialize(s)))
- process.sources.foreach(
- s => builder.addSources(SourceProgressSerializer.serialize(s))
- )
- builder.setSink(SinkProgressSerializer.serialize(process.sink))
- process.observedMetrics.forEach {
- case (k, v) => builder.putObservedMetrics(k, mapper.writeValueAsString(v))
- }
- builder.build()
- }
-
- def deserialize(process: StoreTypes.StreamingQueryProgress): StreamingQueryProgress = {
- new StreamingQueryProgress(
- id = UUID.fromString(process.getId),
- runId = UUID.fromString(process.getRunId),
- name = process.getName,
- timestamp = process.getTimestamp,
- batchId = process.getBatchId,
- batchDuration = process.getBatchDuration,
- durationMs = process.getDurationMsMap,
Review Comment:
How about change line 70 to
```
durationMs = new JHashMap(process.getDurationMsMap)
```
then `UISeleniumWithRocksDBBackendSuite` can pass. What are we worried about? The change performance is poor? Or other problems?
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] gengliangwang commented on pull request #39416: Revert "[SPARK-41677][CORE][SQL][SS][UI] Add Protobuf serializer for StreamingQueryProgressWrapper"
Posted by GitBox <gi...@apache.org>.
gengliangwang commented on PR #39416:
URL: https://github.com/apache/spark/pull/39416#issuecomment-1373130873
@dongjoon-hyun @LuciferYang Thanks for the review.
Merging to master
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on a diff in pull request #39416: Revert "[SPARK-41677][CORE][SQL][SS][UI] Add Protobuf serializer for StreamingQueryProgressWrapper"
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #39416:
URL: https://github.com/apache/spark/pull/39416#discussion_r1063059740
##########
sql/core/src/main/scala/org/apache/spark/status/protobuf/sql/StreamingQueryProgressSerializer.scala:
##########
@@ -1,89 +0,0 @@
-/*
- * 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.status.protobuf.sql
-
-import java.util.{HashMap => JHashMap, Map => JMap, UUID}
-
-import com.fasterxml.jackson.databind.json.JsonMapper
-import com.fasterxml.jackson.module.scala.DefaultScalaModule
-
-import org.apache.spark.sql.Row
-import org.apache.spark.sql.catalyst.expressions.GenericRowWithSchema
-import org.apache.spark.sql.streaming.StreamingQueryProgress
-import org.apache.spark.status.protobuf.StoreTypes
-
-private[protobuf] object StreamingQueryProgressSerializer {
-
- private val mapper: JsonMapper = JsonMapper.builder()
- .addModule(DefaultScalaModule)
- .build()
-
- def serialize(process: StreamingQueryProgress): StoreTypes.StreamingQueryProgress = {
- val builder = StoreTypes.StreamingQueryProgress.newBuilder()
- builder.setId(process.id.toString)
- builder.setRunId(process.runId.toString)
- builder.setName(process.name)
- builder.setTimestamp(process.timestamp)
- builder.setBatchId(process.batchId)
- builder.setBatchDuration(process.batchDuration)
- process.durationMs.forEach {
- case (k, v) => builder.putDurationMs(k, v)
- }
- process.eventTime.forEach {
- case (k, v) => builder.putEventTime(k, v)
- }
- process.stateOperators.foreach(
- s => builder.addStateOperators(StateOperatorProgressSerializer.serialize(s)))
- process.sources.foreach(
- s => builder.addSources(SourceProgressSerializer.serialize(s))
- )
- builder.setSink(SinkProgressSerializer.serialize(process.sink))
- process.observedMetrics.forEach {
- case (k, v) => builder.putObservedMetrics(k, mapper.writeValueAsString(v))
- }
- builder.build()
- }
-
- def deserialize(process: StoreTypes.StreamingQueryProgress): StreamingQueryProgress = {
- new StreamingQueryProgress(
- id = UUID.fromString(process.getId),
- runId = UUID.fromString(process.getRunId),
- name = process.getName,
- timestamp = process.getTimestamp,
- batchId = process.getBatchId,
- batchDuration = process.getBatchDuration,
- durationMs = process.getDurationMsMap,
Review Comment:
OK, I am fine to revert this one first
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] LuciferYang commented on a diff in pull request #39416: Revert "[SPARK-41677][CORE][SQL][SS][UI] Add Protobuf serializer for StreamingQueryProgressWrapper"
Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #39416:
URL: https://github.com/apache/spark/pull/39416#discussion_r1063061428
##########
sql/core/src/main/scala/org/apache/spark/status/protobuf/sql/StreamingQueryProgressSerializer.scala:
##########
@@ -1,89 +0,0 @@
-/*
- * 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.status.protobuf.sql
-
-import java.util.{HashMap => JHashMap, Map => JMap, UUID}
-
-import com.fasterxml.jackson.databind.json.JsonMapper
-import com.fasterxml.jackson.module.scala.DefaultScalaModule
-
-import org.apache.spark.sql.Row
-import org.apache.spark.sql.catalyst.expressions.GenericRowWithSchema
-import org.apache.spark.sql.streaming.StreamingQueryProgress
-import org.apache.spark.status.protobuf.StoreTypes
-
-private[protobuf] object StreamingQueryProgressSerializer {
-
- private val mapper: JsonMapper = JsonMapper.builder()
- .addModule(DefaultScalaModule)
- .build()
-
- def serialize(process: StreamingQueryProgress): StoreTypes.StreamingQueryProgress = {
- val builder = StoreTypes.StreamingQueryProgress.newBuilder()
- builder.setId(process.id.toString)
- builder.setRunId(process.runId.toString)
- builder.setName(process.name)
- builder.setTimestamp(process.timestamp)
- builder.setBatchId(process.batchId)
- builder.setBatchDuration(process.batchDuration)
- process.durationMs.forEach {
- case (k, v) => builder.putDurationMs(k, v)
- }
- process.eventTime.forEach {
- case (k, v) => builder.putEventTime(k, v)
- }
- process.stateOperators.foreach(
- s => builder.addStateOperators(StateOperatorProgressSerializer.serialize(s)))
- process.sources.foreach(
- s => builder.addSources(SourceProgressSerializer.serialize(s))
- )
- builder.setSink(SinkProgressSerializer.serialize(process.sink))
- process.observedMetrics.forEach {
- case (k, v) => builder.putObservedMetrics(k, mapper.writeValueAsString(v))
- }
- builder.build()
- }
-
- def deserialize(process: StoreTypes.StreamingQueryProgress): StreamingQueryProgress = {
- new StreamingQueryProgress(
- id = UUID.fromString(process.getId),
- runId = UUID.fromString(process.getRunId),
- name = process.getName,
- timestamp = process.getTimestamp,
- batchId = process.getBatchId,
- batchDuration = process.getBatchDuration,
- durationMs = process.getDurationMsMap,
Review Comment:
Yes, there are risks. I think it is better to use default JSON serializer for this class for Spark 3.4.0
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] gengliangwang closed pull request #39416: Revert "[SPARK-41677][CORE][SQL][SS][UI] Add Protobuf serializer for StreamingQueryProgressWrapper"
Posted by GitBox <gi...@apache.org>.
gengliangwang closed pull request #39416: Revert "[SPARK-41677][CORE][SQL][SS][UI] Add Protobuf serializer for StreamingQueryProgressWrapper"
URL: https://github.com/apache/spark/pull/39416
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org