You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/11/28 15:06:28 UTC

[GitHub] [arrow-rs] Jimexist commented on a diff in pull request #3210: WIP add more integration test for parquet bloom filter round trip tests

Jimexist commented on code in PR #3210:
URL: https://github.com/apache/arrow-rs/pull/3210#discussion_r1033659334


##########
parquet/pytest/test_parquet_integration.py:
##########
@@ -0,0 +1,112 @@
+# 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.
+import pyspark.sql
+import pandas as pd
+from tempfile import NamedTemporaryFile, TemporaryDirectory
+import subprocess
+import pathlib
+import pytest
+
+
+def create_data_and_spark_df(n):
+    spark = pyspark.sql.SparkSession.builder.getOrCreate()
+    spark.conf.set("parquet.bloom.filter.enabled", True)
+    spark.conf.set("parquet.bloom.filter.expected.ndv", 10)
+    spark.conf.set("parquet.bloom.filter.max.bytes", 32)
+    data = [(f"id-{i % 10}", f"name-{i%10}") for i in range(n)]
+    df = spark.createDataFrame(data, ["id", "name"]).repartition(1)
+    return data, df
+
+
+def create_data_and_pandas_df(n):
+    data = [(f"id-{i % 10}", f"name-{i%10}") for i in range(n)]
+    df = pd.DataFrame(data, columns=["id", "name"])
+    return data, df
+
+
+def get_expected_output(data):
+    expected = ["Row group #0", "=" * 80]
+    for v in data:
+        expected.append(f"Value {v[0]} is present in bloom filter")
+    for v in data:
+        expected.append(f"Value {v[1]} is absent in bloom filter")
+    expected = "\n".join(expected) + "\n"
+    return expected.encode("utf-8")
+
+
+def get_from_csv_cli_output(schema_file, output_file, csv_file):
+    args = [
+        "parquet-fromcsv",
+        "--schema",
+        schema_file,
+        "--enable-bloom-filter",

Review Comment:
   @tustvold it seems that this didn't take effect during writing. any idea why?



-- 
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: github-unsubscribe@arrow.apache.org

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