Open vikramsubramanian opened 7 months ago
Summary: Issue with CopyTo and CopyFrom not aligning with interval datatype format.
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:
interval
datatype in the CSV import functionality (CopyFrom
operation). This code is likely to be in the src/binder/bind/bind_copy.cpp
file or in a related file that handles CSV parsing and interval deserialization.3 years 2 days 13:02:00
. Ensure that it can parse the hours, minutes, and seconds components of the interval string correctly.:02:00
part of the string as a valid time interval (2 hours and 0 minutes).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.
This file contains tests for interval parsing which is relevant to the issue of Copy From
not recognizing interval formats.
This file contains the binding logic for the Copy From
statement, which is likely where the issue with interval datatype recognition needs to be addressed.
src/processor/operator/persistent/copy_to_csv.cpp
This file is related to the Copy To
functionality and may contain the logic for writing interval datatypes to CSV, which is part of the issue.
test/copy/e2e_copy_transaction_test.cpp
This file contains end-to-end tests for copy transactions, which may need to be updated to include tests for the interval datatype issue.
Copy To
will write the interval datatype as the format3 years 2 days 13:02:00
, butCopy From
can not recognize such a format. It will trigger an errorConversion exception: Unrecognized interval specifier string: :02:00." thrown in the test body.
Reproduce:
COPY TO
statement to write into a csv file "test.csv"Copy From
stament to load "test.csv" )