decentriq_util 0.1.0.dev9__tar.gz → 0.1.0.dev11__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {decentriq_util-0.1.0.dev9 → decentriq_util-0.1.0.dev11}/PKG-INFO +1 -1
- decentriq_util-0.1.0.dev11/decentriq_util/logger.py +9 -0
- {decentriq_util-0.1.0.dev9 → decentriq_util-0.1.0.dev11}/decentriq_util/spark/__init__.py +8 -6
- {decentriq_util-0.1.0.dev9 → decentriq_util-0.1.0.dev11}/pyproject.toml +1 -1
- {decentriq_util-0.1.0.dev9 → decentriq_util-0.1.0.dev11}/decentriq_util/__init__.py +0 -0
- {decentriq_util-0.1.0.dev9 → decentriq_util-0.1.0.dev11}/decentriq_util/error.py +0 -0
- {decentriq_util-0.1.0.dev9 → decentriq_util-0.1.0.dev11}/decentriq_util/proto/__init__.py +0 -0
- {decentriq_util-0.1.0.dev9 → decentriq_util-0.1.0.dev11}/decentriq_util/python/__init__.py +0 -0
- {decentriq_util-0.1.0.dev9 → decentriq_util-0.1.0.dev11}/decentriq_util/sql/__init__.py +0 -0
- {decentriq_util-0.1.0.dev9 → decentriq_util-0.1.0.dev11}/decentriq_util/sql/proto/__init__.py +0 -0
- {decentriq_util-0.1.0.dev9 → decentriq_util-0.1.0.dev11}/decentriq_util/sql/proto/compute_sql_pb2.py +0 -0
- {decentriq_util-0.1.0.dev9 → decentriq_util-0.1.0.dev11}/decentriq_util/sql/proto/compute_sql_pb2.pyi +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
logger = logging.getLogger("decentriq_util")
|
|
5
|
+
ch = logging.StreamHandler()
|
|
6
|
+
ch.setLevel(logging.INFO)
|
|
7
|
+
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
|
8
|
+
ch.setFormatter(formatter)
|
|
9
|
+
logger.addHandler(ch)
|
|
@@ -4,8 +4,8 @@ from contextlib import contextmanager
|
|
|
4
4
|
import multiprocessing
|
|
5
5
|
import math
|
|
6
6
|
import os
|
|
7
|
-
import shutil
|
|
8
7
|
import psutil
|
|
8
|
+
from ..logger import logger
|
|
9
9
|
|
|
10
10
|
import pyarrow.parquet as pq
|
|
11
11
|
from pyspark.sql import SparkSession
|
|
@@ -36,7 +36,7 @@ def _get_cgroup_memory() -> int:
|
|
|
36
36
|
if max_memory is not None:
|
|
37
37
|
return max_memory
|
|
38
38
|
else:
|
|
39
|
-
|
|
39
|
+
logger.info("Unable to determine available memory from cgroup, assuming 4G")
|
|
40
40
|
return 4 * 1024 * 1024 * 1024
|
|
41
41
|
|
|
42
42
|
|
|
@@ -118,9 +118,9 @@ def _get_num_partitions(
|
|
|
118
118
|
break
|
|
119
119
|
target_partition_size = target_partition_size / 2
|
|
120
120
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
logger.info(f"File size: {file_size}")
|
|
122
|
+
logger.info(f"Max target partition size: {max_target_partition_size}")
|
|
123
|
+
logger.info(f"Target partition size: {target_partition_size}")
|
|
124
124
|
|
|
125
125
|
num_partitions = int(math.ceil(file_size / target_partition_size))
|
|
126
126
|
|
|
@@ -148,7 +148,6 @@ def _determine_optimal_spark_settings(
|
|
|
148
148
|
("spark.driver.cores", str(cpu_count)),
|
|
149
149
|
("spark.driver.memory", str(spark_memory_4096)),
|
|
150
150
|
]
|
|
151
|
-
print("Spark settings:\n" + f"\n".join([str(x) for x in settings]))
|
|
152
151
|
|
|
153
152
|
return settings
|
|
154
153
|
|
|
@@ -192,6 +191,9 @@ def _create_spark_session(
|
|
|
192
191
|
)
|
|
193
192
|
for (key, value) in config:
|
|
194
193
|
ss = ss.config(key, value)
|
|
194
|
+
|
|
195
|
+
logger.info("Spark settings:\n" + f"\n".join([str(x) for x in config]))
|
|
196
|
+
|
|
195
197
|
return ss.getOrCreate()
|
|
196
198
|
|
|
197
199
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{decentriq_util-0.1.0.dev9 → decentriq_util-0.1.0.dev11}/decentriq_util/sql/proto/__init__.py
RENAMED
|
File without changes
|
{decentriq_util-0.1.0.dev9 → decentriq_util-0.1.0.dev11}/decentriq_util/sql/proto/compute_sql_pb2.py
RENAMED
|
File without changes
|
|
File without changes
|