924060929 commented on code in PR #33013: URL: https://github.com/apache/doris/pull/33013#discussion_r1548881100
########## fe/fe-core/src/main/java/org/apache/doris/analysis/LiteralExpr.java: ########## @@ -479,4 +481,22 @@ public boolean isZero() { } return isZero; } + + public static LiteralExpr getLiteralExprFromThrift(TExprNode node) throws AnalysisException { + TExprNodeType type = node.node_type; + switch (type) { + case NULL_LITERAL: return new NullLiteral(); + case BOOL_LITERAL: return new BoolLiteral(node.bool_literal.value); + case INT_LITERAL: return new IntLiteral(node.int_literal.value); + case LARGE_INT_LITERAL: return new LargeIntLiteral(node.large_int_literal.value); + case FLOAT_LITERAL: return new FloatLiteral(node.float_literal.value); + case DECIMAL_LITERAL: return new DecimalLiteral(node.decimal_literal.value); + case STRING_LITERAL: return new StringLiteral(node.string_literal.value); + case JSON_LITERAL: return new JsonLiteral(node.json_literal.value); + case DATE_LITERAL: return new DateLiteral(node.date_literal.value); + case IPV4_LITERAL: return new IPv4Literal(node.ipv4_literal.value); + case IPV6_LITERAL: return new IPv6Literal(node.ipv6_literal.value); + default: throw new AnalysisException("Wrong type from thrift;"); Review Comment: maybe we should skip deserialize this literal? ########## fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java: ########## @@ -654,4 +663,18 @@ public TMasterOpResult proxyExecute(TMasterOpRequest request) { public void processOnce() throws IOException, NotImplementedException { throw new NotImplementedException("Not Impl processOnce"); } + + private Map<String, LiteralExpr> userVariableFromThrift(Map<String, TExprNode> thriftMap) throws TException { + try { + Map<String, LiteralExpr> userVariables = Maps.newHashMap(); + for (Map.Entry<String, TExprNode> entry : thriftMap.entrySet()) { + TExprNode tExprNode = entry.getValue(); + LiteralExpr literalExpr = LiteralExpr.getLiteralExprFromThrift(tExprNode); + userVariables.put(entry.getKey(), literalExpr); + } + return userVariables; + } catch (AnalysisException e) { + throw new TException(e.getMessage()); Review Comment: ditto -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org