question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG]: Error while trying to enumerate a DataFrame containing a column of type date: The method or operation is not implemented.

See original GitHub issue

Describe the bug An error occurred while trying to enumerate a DataFrame containing a column of type date.

To Reproduce Steps to reproduce the behavior:

public void Test()
{
  var dataFrame1 = spark.Session.Sql("SELECT * FROM VALUES ('2020-1-1'), ('2020-1-2') AS (DateAsString)");
  dataFrame1.Show();
  dataFrame1.PrintSchema();
  var rows1 = dataFrame1.Collect().Count(); // returns 2

  var dataFrame2 = spark.Session.Sql("SELECT * FROM VALUES CAST('2020-1-1' AS date), CAST('2020-1-2' AS date) AS (DateAsDate)");
  dataFrame2.Show();
  dataFrame2.PrintSchema();
  var rows2 = dataFrame2.Collect().Count(); // failed with "System.NotImplementedException" {"The method or operation is not implemented."}
}

Command-Line output: ±-----------+ |DateAsString| ±-----------+ | 2020-1-1| | 2020-1-2| ±-----------+

root |-- DateAsString: string (nullable = false)

±---------+ |DateAsDate| ±---------+ |2020-01-01| |2020-01-02| ±---------+

root |-- DateAsDate: date (nullable = true)

Exception “System.NotImplementedException: The method or operation is not implemented. at Microsoft.Spark.Sql.Row.Convert() at Microsoft.Spark.Sql.Row…ctor(Object[] values, StructType schema) at Microsoft.Spark.Sql.RowConstructor.GetRow() at Microsoft.Spark.Sql.RowCollector.Collect(ISocketWrapper socket)+MoveNext() at Microsoft.Spark.Sql.DataFrame.GetRows(String funcName)+MoveNext() at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source) at MyTest.Test() in …”

Expected behavior A DataFrame containing columns of type date can be enumerated.

Additional context Tested with a latest version (0.7.0) of the .net spark library.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ravshMSFTcommented, Feb 21, 2020

Upgraded to 0.9.0 and this issue is resolved.

1reaction
elvaliuliuliucommented, Feb 20, 2020

Can you try with Spark.NET v0.9.0? I think this should work with the new version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pandas: Location of a row with error
Ideally, the problem can be avoided by making sure the values stored in the DataFrame are already ints not strings when the DataFrame...
Read more >
Dealing With Dates in Pandas — 6 Common Operations ...
As shown above, the problem is that the date column is read as an object type instead of a date type, which prevents...
Read more >
SettingwithCopyWarning: How to Fix This Warning in Pandas
The first is an access method (get operation), that will return a DataFrame containing all rows where bidder equals 'parakeet2004' . The second ......
Read more >
How to iterate over rows in Pandas: Most efficient options
Most straightforward row iteration. The most straightforward method for iterating over rows is with the iterrows() method, like so:.
Read more >
Time series / date functionality
Assembling datetime from multiple DataFrame columns​​ pd. to_datetime looks for standard designations of the datetime component in the column names, including:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found