clintropolis commented on a change in pull request #12241:
URL: https://github.com/apache/druid/pull/12241#discussion_r802302489
##########
File path:
sql/src/main/java/org/apache/druid/sql/calcite/expression/DruidExpression.java
##########
@@ -32,127 +32,303 @@
import org.apache.druid.segment.virtual.ExpressionVirtualColumn;
import javax.annotation.Nullable;
+import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.function.Function;
/**
+ * todo(clint): rewrite javadocs
+ *
* Represents two kinds of expression-like concepts that native Druid queries
support:
*
* (1) SimpleExtractions, which are direct column access, possibly with an
extractionFn
* (2) native Druid expressions.
*/
public class DruidExpression
{
+ public enum NodeType
+ {
+ /**
+ * constant value
+ */
+ LITERAL,
+ /**
+ * Identifier for a direct physical or virtual column access (column name
or virtual column name)
+ */
+ IDENTIFIER,
+ /**
+ * Standard native druid expression, which can compute a string that can
be parsed into {@link Expr}, or used
+ * as an {@link ExpressionVirtualColumn}
+ */
+ EXPRESSION,
+ /**
+ * Expression backed by a specialized {@link VirtualColumn}, which might
provide more optimized evaluation than
+ * is possible with the standard
+ */
+ SPECIALIZED
+ }
+
// Must be sorted
private static final char[] SAFE_CHARS = "
,._-;:(){}[]<>!@#$%^&*`~?/".toCharArray();
+ private static final VirtualColumnBuilder DEFAULT_VIRTUAL_COLUMN_BUILDER =
new ExpressionVirtualColumnBuilder();
Review comment:
no reason, just seemed wasteful because is stateless
##########
File path:
sql/src/main/java/org/apache/druid/sql/calcite/expression/DruidExpression.java
##########
@@ -32,127 +32,303 @@
import org.apache.druid.segment.virtual.ExpressionVirtualColumn;
import javax.annotation.Nullable;
+import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.function.Function;
/**
+ * todo(clint): rewrite javadocs
Review comment:
oops :+1:
--
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]