Mayil-AI-Sandbox / kuzudb_jan15

MIT License
0 stars 0 forks source link

CopyTo and CopyFrom do not align with interval datatype (hashtag2882) #7

Open vikramsubramanian opened 7 months ago

vikramsubramanian commented 7 months ago

Copy To will write the interval datatype as the format 3 years 2 days 13:02:00, but Copy From can not recognize such a format. It will trigger an error Conversion exception: Unrecognized interval specifier string: :02:00." thrown in the test body.

Reproduce:

  1. load node Table vPerson from the tinysnb dataset
  2. using COPY TO statement to write into a csv file "test.csv"
  3. using Copy Fromstament to load "test.csv" )
mayil-ai[bot] commented 7 months ago

Summary: Issue with CopyTo and CopyFrom not aligning with interval datatype format.

Possible Solution

Based on the provided information and code snippets, the issue seems to be related to the handling of the interval datatype during the CopyFrom operation. The error message indicates that the CopyFrom function cannot recognize the interval specifier string :02:00 when loading data from a CSV file.

To resolve the issue, follow these steps:

The relevant code snippet for interval parsing is in the test/common/interval_test.cpp file, which contains tests for the Interval::fromCString function. This function is likely used in the CSV import process to convert interval strings from the CSV file into the internal interval_t representation. The fix should ensure that the Interval::fromCString function or its equivalent in the actual import code can handle the full interval format, including hours and minutes.

Code snippets to check