dotnet / dotnet/spark

[BUG]: .Option("query", "SELECT 0 FROM DUAL")

Open
#1,006 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
2.1k
Forks
332
Avg merge
1d 20h
Merged PRs (30d)
9

Description

**Describe the bug**
While using connection to a Oracle DB if we use an option to "SELECT 0 FROM DUAL" (I know is a stupid usage of the tool, but to better understand the problem let's use this example) we got this error.

System.FormatException: Input string was not in a correct format.
at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
at System.Number.ParseDecimal(ReadOnlySpan`1 value, NumberStyles styles, NumberFormatInfo info)
at System.Convert.ToDecimal(String value, IFormatProvider provider)
at Razorvine.Pickle.Objects.DecimalConstructor.construct(Object[] args)
at Razorvine.Pickle.UnpicklerImplementation`1.load_reduce()
at Razorvine.Pickle.UnpicklerImplementation`1.Load()
at Razorvine.Pickle.Unpickler.loads(Byte[] pickledata, Int32 stackCapacity)
at Razorvine.Pickle.Unpickler.loads(ReadOnlyMemory`1 pickledata, Int32 stackCapacity)
at Microsoft.Spark.Utils.PythonSerDe.GetUnpickledObjects(Stream stream, Int32 messageLength)
at Microsoft.Spark.Sql.RowCollector.Collect(ISocketWrapper socket)+MoveNext()
at Microsoft.Spark.Sql.DataFrame.GetRows(String funcName, Object[] args)+MoveNext()

If we return any 0(Zero) value from the query we got this error.

I don´t know if we are using wrongly or there is something we gotta do, any help is any help is much appreciated.

**To Reproduce**

Steps to reproduce the behavior:
1. Connect to Oracle DB
2. Execute a simple query example: "SELECT 0 FROM DUAL"
4. See error

**Expected behavior**
Return a DataFrame with value 0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.