-
Notifications
You must be signed in to change notification settings - Fork 50
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
support more type in postgres-extended #94
Conversation
todo!("Don't support {} type now.", column.type_().name()) | ||
} | ||
} | ||
generate_process!(column,row, output,idx, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why to use macro here? How is it simplier than before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reduce duplication like
Type::NUMERIC => {
single_process!(row, output, idx, Decimal);
}
Type::TIMESTAMP => {
single_process!(row, output, idx, NaiveDateTime);
}
Type::DATE => {
single_process!(row, output, idx, NaiveDate);
}
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO such level of duplication is fine. Macro seems an overkill and hurts readability.
d7bf3c5
to
a0fb44b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, why would you want to format the time results instead of keeping it as-is? What's the motivation? 👀
Because for the time type(such as INTERVAL), there is more than one string format representing the same value. More detail: #93 |
ed3b667
to
229a726
Compare
But maybe some users do want to depend on such behavior, and the db implementation want to respect the behavior? (😅 |
BTW this will make |
In risingwave, Postgres and Postgres-extended have different e2e tests now. So I think it's acceptable to make it not compatible now. After introducing the custom comparator, we can make it compatible I think. 🤔 |
Actually it's still not 100% "compatible". Specifically if it can pass Maybe we need to completely switch to |
We can't completely switch to postgres-extended because there are some type can't support in postgres-extended such as multi-dimensional array and struct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally I think of rewriting all of SQL queries that output date time column, so that they won't directly appear in sqllogictest. e.g, to_char(interval '15h 2m 12s', 'HH24:MI:SS')
. Anyway, this approach also LGTM.
Ping me when you're ready to merge and release a new version. |
I'm aware of actually we can use |
Signed-off-by: Zejiong Dong <[email protected]>
229a726
to
227cf89
Compare
* support array type Signed-off-by: Zejiong Dong <[email protected]>
227cf89
to
c67bd5e
Compare
I use this way to convert the
|
LGTM, merging now. |
This PR does two things: