Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expr: complete string <-> datum casts #1378

Closed
benesch opened this issue Dec 21, 2019 · 7 comments · Fixed by #1429 or #2026
Closed

expr: complete string <-> datum casts #1378

benesch opened this issue Dec 21, 2019 · 7 comments · Fixed by #1429 or #2026
Assignees
Labels
A-dataflow Area: dataflow C-feature Category: new feature or request
Milestone

Comments

@benesch
Copy link
Member

benesch commented Dec 21, 2019

For every datum variant, there should be a cast from string and a cast to string. Once #1377 is complete, the cast functions will be a trivial wrapper over the conversion functions in repr.

@benesch benesch added the C-feature Category: new feature or request label Dec 21, 2019
@benesch benesch mentioned this issue Dec 21, 2019
40 tasks
@benesch benesch added the A-dataflow Area: dataflow label Dec 21, 2019
@benesch benesch added this to the Prospect Demo milestone Dec 21, 2019
@cuongdo
Copy link
Contributor

cuongdo commented Jan 6, 2020

This is especially important for file-based sources that are parsed using a regex. Each column in such a source is a string, so it's impossible to perform basic calculations such as avg without being able to cast the column into a numeric type.

@benesch
Copy link
Member Author

benesch commented Jan 6, 2020

Hopefully landing this week! The number of roadblocks here has been astounding. #1448 + #1444 + #1429 + some code movement of our existing date/timestamp[tz]/interval logic will finally get us there.

@benesch benesch reopened this Jan 8, 2020
@benesch
Copy link
Member Author

benesch commented Jan 8, 2020

Still remaining:

  • text -> date
  • text -> timestamp
  • text -> timestamptz
  • text -> interval

@cuongdo
Copy link
Contributor

cuongdo commented Jan 8, 2020

Are text -> date casts supposed to work right now? I can't get them to work:

cdo=> SELECT COALESCE(CAST('2020-01-01' AS DATE), '(null)');
 coalesce
----------
 (null)
(1 row)

@cuongdo cuongdo modified the milestones: Prospect Demo, Public Beta Jan 8, 2020
@benesch
Copy link
Member Author

benesch commented Jan 8, 2020

D'oh, I wrote those all backwards. Sorry.

@benesch
Copy link
Member Author

benesch commented Jan 8, 2020

(As in, text -> {date, timestamp, timestamptz, interval} are all still TODO, because they'll conflict badly with #1444.)

@cuongdo
Copy link
Contributor

cuongdo commented Jan 22, 2020

Assigning to @sploiselle, who I hear is going to be finishing off the remaining casts as a follow-up to his INTERVAL work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dataflow Area: dataflow C-feature Category: new feature or request
Projects
None yet
4 participants