/
githubmirror
/
spark
Обзор
Документация
Войти
/
githubmirror
/
spark
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
python/pyspark/sql/connect/profiler.py
41 строка
1 KB
Tian Gao
[SPARK-56387][PYTHON][FOLLOWUP] Keep the original profiler result and create v2 for new format
30 апр 2026, 04:15
30 апр 2026, 04:15
759637a
Код
Авторство
О чём код?
# # 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. # from typing import TYPE_CHECKING from pyspark.sql.profiler import ProfilerCollector, ProfileResultsParamV2 if TYPE_CHECKING: from pyspark.sql._typing import ProfileResultsV2 class ConnectProfilerCollector(ProfilerCollector): """ ProfilerCollector for Spark Connect. """ def __init__(self) -> None: super().__init__() self._value = ProfileResultsParamV2.zero({}) @property def _profile_results(self) -> "ProfileResultsV2": with self._lock: return self._value if self._value is not None else {} def _update(self, update: "ProfileResultsV2") -> None: with self._lock: self._value = ProfileResultsParamV2.addInPlace(self._profile_results, update)