findepi commented on code in PR #17332:
URL: https://github.com/apache/datafusion/pull/17332#discussion_r2355658394
##########
datafusion/expr/src/expr.rs:
##########
@@ -1384,6 +1412,130 @@ impl GroupingSet {
}
}
+#[derive(Clone, PartialEq, Eq, PartialOrd, Hash, Debug)]
+#[cfg(not(feature = "sql"))]
+pub struct IlikeSelectItem {
+ pub pattern: String,
+}
+#[cfg(not(feature = "sql"))]
+impl Display for IlikeSelectItem {
+ fn fmt(&self, f: &mut Formatter) -> fmt::Result {
+ write!(f, "ILIKE '{}'", &self.pattern)?;
+ Ok(())
+ }
+}
+#[derive(Clone, PartialEq, Eq, PartialOrd, Hash, Debug)]
+#[cfg(not(feature = "sql"))]
+pub enum ExcludeSelectItem {
+ Single(Ident),
+ Multiple(Vec<Ident>),
+}
+#[cfg(not(feature = "sql"))]
+impl Display for ExcludeSelectItem {
+ fn fmt(&self, f: &mut Formatter) -> fmt::Result {
+ write!(f, "EXCLUDE")?;
+ match self {
+ Self::Single(column) => {
+ write!(f, " {column}")?;
+ }
+ Self::Multiple(columns) => {
+ write!(f, " ({})", display_comma_separated(columns))?;
+ }
+ }
+ Ok(())
+ }
+}
+#[derive(Clone, PartialEq, Eq, PartialOrd, Hash, Debug)]
+#[cfg(not(feature = "sql"))]
+pub struct ExceptSelectItem {
+ pub first_element: Ident,
+ pub additional_elements: Vec<Ident>,
+}
+#[cfg(not(feature = "sql"))]
+impl Display for ExceptSelectItem {
+ fn fmt(&self, f: &mut Formatter) -> fmt::Result {
+ write!(f, "EXCEPT ")?;
+ if self.additional_elements.is_empty() {
+ write!(f, "({})", self.first_element)?;
+ } else {
+ write!(
+ f,
+ "({}, {})",
+ self.first_element,
+ display_comma_separated(&self.additional_elements)
+ )?;
+ }
+ Ok(())
+ }
+}
Review Comment:
The expr crate should become un-dependent from sqlparser::ast types, so
these copies should be the only types we use.
Is there a follow-up issue planned to cleanup these duplicate types?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]