[jira] [Updated] (SPARK-41817) SparkSession.read support reading with schema
[ https://issues.apache.org/jira/browse/SPARK-41817?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sandeep Singh updated SPARK-41817: -- Description: {code:java} File "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/readwriter.py", line 122, in pyspark.sql.connect.readwriter.DataFrameReader.load Failed example: with tempfile.TemporaryDirectory() as d: # Write a DataFrame into a CSV file with a header df = spark.createDataFrame([{"age": 100, "name": "Hyukjin Kwon"}]) df.write.option("header", True).mode("overwrite").format("csv").save(d) # Read the CSV file as a DataFrame with 'nullValue' option set to 'Hyukjin Kwon', # and 'header' option set to `True`. df = spark.read.load( d, schema=df.schema, format="csv", nullValue="Hyukjin Kwon", header=True) df.printSchema() df.show() Exception raised: Traceback (most recent call last): File "/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/doctest.py", line 1350, in __run exec(compile(example.source, filename, "single", File "", line 10, in df.printSchema() File "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/dataframe.py", line 1039, in printSchema print(self._tree_string()) File "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/dataframe.py", line 1035, in _tree_string query = self._plan.to_proto(self._session.client) File "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/plan.py", line 92, in to_proto plan.root.CopyFrom(self.plan(session)) File "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/plan.py", line 245, in plan plan.read.data_source.schema = self.schema TypeError: bad argument type for built-in operation {code} was: {code} File "/.../spark/python/pyspark/sql/connect/group.py", line 183, in pyspark.sql.connect.group.GroupedData.pivot Failed example: df2 = spark.createDataFrame([ Row(training="expert", sales=Row(course="dotNET", year=2012, earnings=1)), Row(training="junior", sales=Row(course="Java", year=2012, earnings=2)), Row(training="expert", sales=Row(course="dotNET", year=2012, earnings=5000)), Row(training="junior", sales=Row(course="dotNET", year=2013, earnings=48000)), Row(training="expert", sales=Row(course="Java", year=2013, earnings=3)), ]) Exception raised: Traceback (most recent call last): File "/.../miniconda3/envs/python3.9/lib/python3.9/doctest.py", line 1336, in __run exec(compile(example.source, filename, "single", File "", line 1, in df2 = spark.createDataFrame([ File "/.../workspace/forked/spark/python/pyspark/sql/connect/session.py", line 196, in createDataFrame table = pa.Table.from_pandas(pdf) File "pyarrow/table.pxi", line 3475, in pyarrow.lib.Table.from_pandas File "/.../miniconda3/envs/python3.9/lib/python3.9/site-packages/pyarrow/pandas_compat.py", line 611, in dataframe_to_arrays arrays = [convert_column(c, f) File "/.../miniconda3/envs/python3.9/lib/python3.9/site-packages/pyarrow/pandas_compat.py", line 611, in arrays = [convert_column(c, f) File "/.../miniconda3/envs/python3.9/lib/python3.9/site-packages/pyarrow/pandas_compat.py", line 598, in convert_column raise e File "/.../miniconda3/envs/python3.9/lib/python3.9/site-packages/pyarrow/pandas_compat.py", line 592, in convert_column result = pa.array(col, type=type_, from_pandas=True, safe=safe) File "pyarrow/array.pxi", line 316, in pyarrow.lib.array File "pyarrow/array.pxi", line 83, in pyarrow.lib._ndarray_to_array File "pyarrow/error.pxi", line 123, in pyarrow.lib.check_status pyarrow.lib.ArrowTypeError: ("Expected bytes, got a 'int' object", 'Conversion failed for column 1 with type object') {code} > SparkSession.read support reading with schema > - > > Key: SPARK-41817 > URL: https://issues.apache.org/jira/browse/SPARK-41817 > Project: Spark > Issue Type: Sub-task > Components: Connect >Affects Versions: 3.4.0 >Reporter: Sandeep Singh >Priority: Major > > {code:java} > File > "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/readwriter.py", > line 122, in pyspark.sql.connect.readwriter.DataFrameReader.load > Failed example: > with tempfile.TemporaryDirectory() as d: > # Write a DataFrame into a CSV file with a header > df = spark.createDataFrame([{"age": 100, "name": "Hyukjin Kwon"}]) > df.write.option("header", > True).mode("overwrite").format("csv").save(d) > # Read the CSV file as a DataFrame with 'nullValue' op
[jira] [Updated] (SPARK-41817) SparkSession.read support reading with schema
[ https://issues.apache.org/jira/browse/SPARK-41817?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Hyukjin Kwon updated SPARK-41817: - Parent: (was: SPARK-41281) Issue Type: Bug (was: Sub-task) > SparkSession.read support reading with schema > - > > Key: SPARK-41817 > URL: https://issues.apache.org/jira/browse/SPARK-41817 > Project: Spark > Issue Type: Bug > Components: Connect >Affects Versions: 3.4.0 >Reporter: Sandeep Singh >Priority: Major > > {code:java} > File > "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/readwriter.py", > line 122, in pyspark.sql.connect.readwriter.DataFrameReader.load > Failed example: > with tempfile.TemporaryDirectory() as d: > # Write a DataFrame into a CSV file with a header > df = spark.createDataFrame([{"age": 100, "name": "Hyukjin Kwon"}]) > df.write.option("header", > True).mode("overwrite").format("csv").save(d) > # Read the CSV file as a DataFrame with 'nullValue' option set to > 'Hyukjin Kwon', > # and 'header' option set to `True`. > df = spark.read.load( > d, schema=df.schema, format="csv", nullValue="Hyukjin Kwon", > header=True) > df.printSchema() > df.show() > Exception raised: > Traceback (most recent call last): > File > "/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/doctest.py", > line 1350, in __run > exec(compile(example.source, filename, "single", > File " pyspark.sql.connect.readwriter.DataFrameReader.load[1]>", line 10, in > df.printSchema() > File > "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/dataframe.py", > line 1039, in printSchema > print(self._tree_string()) > File > "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/dataframe.py", > line 1035, in _tree_string > query = self._plan.to_proto(self._session.client) > File > "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/plan.py", line > 92, in to_proto > plan.root.CopyFrom(self.plan(session)) > File > "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/plan.py", line > 245, in plan > plan.read.data_source.schema = self.schema > TypeError: bad argument type for built-in operation {code} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Updated] (SPARK-41817) SparkSession.read support reading with schema
[ https://issues.apache.org/jira/browse/SPARK-41817?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Hyukjin Kwon updated SPARK-41817: - Epic Link: SPARK-39375 > SparkSession.read support reading with schema > - > > Key: SPARK-41817 > URL: https://issues.apache.org/jira/browse/SPARK-41817 > Project: Spark > Issue Type: Bug > Components: Connect >Affects Versions: 3.4.0 >Reporter: Sandeep Singh >Priority: Major > > {code:java} > File > "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/readwriter.py", > line 122, in pyspark.sql.connect.readwriter.DataFrameReader.load > Failed example: > with tempfile.TemporaryDirectory() as d: > # Write a DataFrame into a CSV file with a header > df = spark.createDataFrame([{"age": 100, "name": "Hyukjin Kwon"}]) > df.write.option("header", > True).mode("overwrite").format("csv").save(d) > # Read the CSV file as a DataFrame with 'nullValue' option set to > 'Hyukjin Kwon', > # and 'header' option set to `True`. > df = spark.read.load( > d, schema=df.schema, format="csv", nullValue="Hyukjin Kwon", > header=True) > df.printSchema() > df.show() > Exception raised: > Traceback (most recent call last): > File > "/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/doctest.py", > line 1350, in __run > exec(compile(example.source, filename, "single", > File " pyspark.sql.connect.readwriter.DataFrameReader.load[1]>", line 10, in > df.printSchema() > File > "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/dataframe.py", > line 1039, in printSchema > print(self._tree_string()) > File > "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/dataframe.py", > line 1035, in _tree_string > query = self._plan.to_proto(self._session.client) > File > "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/plan.py", line > 92, in to_proto > plan.root.CopyFrom(self.plan(session)) > File > "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/plan.py", line > 245, in plan > plan.read.data_source.schema = self.schema > TypeError: bad argument type for built-in operation {code} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Updated] (SPARK-41817) SparkSession.read support reading with schema
[ https://issues.apache.org/jira/browse/SPARK-41817?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Hyukjin Kwon updated SPARK-41817: - Epic Link: (was: SPARK-39375) > SparkSession.read support reading with schema > - > > Key: SPARK-41817 > URL: https://issues.apache.org/jira/browse/SPARK-41817 > Project: Spark > Issue Type: Sub-task > Components: Connect >Affects Versions: 3.4.0 >Reporter: Sandeep Singh >Priority: Major > > {code:java} > File > "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/readwriter.py", > line 122, in pyspark.sql.connect.readwriter.DataFrameReader.load > Failed example: > with tempfile.TemporaryDirectory() as d: > # Write a DataFrame into a CSV file with a header > df = spark.createDataFrame([{"age": 100, "name": "Hyukjin Kwon"}]) > df.write.option("header", > True).mode("overwrite").format("csv").save(d) > # Read the CSV file as a DataFrame with 'nullValue' option set to > 'Hyukjin Kwon', > # and 'header' option set to `True`. > df = spark.read.load( > d, schema=df.schema, format="csv", nullValue="Hyukjin Kwon", > header=True) > df.printSchema() > df.show() > Exception raised: > Traceback (most recent call last): > File > "/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/doctest.py", > line 1350, in __run > exec(compile(example.source, filename, "single", > File " pyspark.sql.connect.readwriter.DataFrameReader.load[1]>", line 10, in > df.printSchema() > File > "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/dataframe.py", > line 1039, in printSchema > print(self._tree_string()) > File > "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/dataframe.py", > line 1035, in _tree_string > query = self._plan.to_proto(self._session.client) > File > "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/plan.py", line > 92, in to_proto > plan.root.CopyFrom(self.plan(session)) > File > "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/plan.py", line > 245, in plan > plan.read.data_source.schema = self.schema > TypeError: bad argument type for built-in operation {code} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Updated] (SPARK-41817) SparkSession.read support reading with schema
[ https://issues.apache.org/jira/browse/SPARK-41817?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Hyukjin Kwon updated SPARK-41817: - Parent: SPARK-41284 Issue Type: Sub-task (was: Bug) > SparkSession.read support reading with schema > - > > Key: SPARK-41817 > URL: https://issues.apache.org/jira/browse/SPARK-41817 > Project: Spark > Issue Type: Sub-task > Components: Connect >Affects Versions: 3.4.0 >Reporter: Sandeep Singh >Priority: Major > > {code:java} > File > "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/readwriter.py", > line 122, in pyspark.sql.connect.readwriter.DataFrameReader.load > Failed example: > with tempfile.TemporaryDirectory() as d: > # Write a DataFrame into a CSV file with a header > df = spark.createDataFrame([{"age": 100, "name": "Hyukjin Kwon"}]) > df.write.option("header", > True).mode("overwrite").format("csv").save(d) > # Read the CSV file as a DataFrame with 'nullValue' option set to > 'Hyukjin Kwon', > # and 'header' option set to `True`. > df = spark.read.load( > d, schema=df.schema, format="csv", nullValue="Hyukjin Kwon", > header=True) > df.printSchema() > df.show() > Exception raised: > Traceback (most recent call last): > File > "/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/doctest.py", > line 1350, in __run > exec(compile(example.source, filename, "single", > File " pyspark.sql.connect.readwriter.DataFrameReader.load[1]>", line 10, in > df.printSchema() > File > "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/dataframe.py", > line 1039, in printSchema > print(self._tree_string()) > File > "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/dataframe.py", > line 1035, in _tree_string > query = self._plan.to_proto(self._session.client) > File > "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/plan.py", line > 92, in to_proto > plan.root.CopyFrom(self.plan(session)) > File > "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/plan.py", line > 245, in plan > plan.read.data_source.schema = self.schema > TypeError: bad argument type for built-in operation {code} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org