@Override public Void visitConvertExpression(ConvertExpression e, StringBuilder sb) throws RuntimeException { sb.append(e.getConvertFunction()).append("("); e.getInput().accept(this, sb); sb.append(", '").append(e.getEncodingType()).append("')"); return null; }
public static LogicalExpression createConvert(String function, String conversionType, LogicalExpression expr, ExpressionPosition ep) { return new ConvertExpression(function, conversionType, expr, ep); }
@Override public HoldingContainer visitConvertExpression(ConvertExpression e, ClassGenerator<?> value) throws RuntimeException { String convertFunctionName = e.getConvertFunction() + e.getEncodingType(); List<LogicalExpression> newArgs = Lists.newArrayList(); newArgs.add(e.getInput()); // input_expr FunctionCall fc = new FunctionCall(convertFunctionName, newArgs, e.getPosition()); return fc.accept(this, value); }
@Override public Boolean visitConvertExpression(ConvertExpression e, ErrorCollector value) throws RuntimeException { return e.getInput().accept(this, value); }
private Boolean visitRowKeyPrefixConvertExpression(ConvertExpression e, int prefixLength, LogicalExpression valueArg) { String encodingType = e.getEncodingType(); rowKeyPrefixStartRow = HConstants.EMPTY_START_ROW; rowKeyPrefixStopRow = HConstants.EMPTY_START_ROW;
@Override public Boolean visitConvertExpression(ConvertExpression e, LogicalExpression value) throws RuntimeException { if (!(value instanceof ConvertExpression)) { return false; } if (!e.getConvertFunction().equals(((ConvertExpression) value).getConvertFunction())) { return false; } return checkChildren(e, value); }
@Override public LogicalExpression visitConvertExpression(ConvertExpression e, FunctionLookupContext functionLookupContext) { String convertFunctionName = e.getConvertFunction() + e.getEncodingType(); List<LogicalExpression> newArgs = Lists.newArrayList(); newArgs.add(e.getInput()); //input_expr FunctionCall fc = new FunctionCall(convertFunctionName, newArgs, e.getPosition()); return fc.accept(this, functionLookupContext); }
@Override public Void visitConvertExpression(ConvertExpression e, ErrorCollector value) throws RuntimeException { return e.getInput().accept(this, value); }
private Boolean visitRowKeyPrefixConvertExpression(ConvertExpression e, int prefixLength, LogicalExpression valueArg) { String encodingType = e.getEncodingType(); rowKeyPrefixStartRow = HConstants.EMPTY_START_ROW; rowKeyPrefixStopRow = HConstants.EMPTY_START_ROW;
@Override public Boolean visitConvertExpression(ConvertExpression e, LogicalExpression valueArg) throws RuntimeException { if (ConvertExpression.CONVERT_FROM.equals(e.getConvertFunction())) { String encodingType = e.getEncodingType(); int prefixLength; if (e.getInput() instanceof FunctionCall) { FunctionCall call = (FunctionCall)e.getInput(); String functionName = call.getName(); if (!functionName.equalsIgnoreCase("byte_substr")) { if (e.getInput() instanceof SchemaPath) { ByteBuf bb = null; switch (encodingType) { case "UTF8": return e.getInput().accept(this, valueArg); default: bb = getByteBuf(valueArg, encodingType); this.path = (SchemaPath)e.getInput(); return true;
@Override public Boolean visitConvertExpression(ConvertExpression e, ErrorCollector errors) throws RuntimeException { return e.getInput().accept(this, errors); }
@Override public Boolean visitFunctionCall(FunctionCall call, LogicalExpression valueArg) { Matcher matcher = convertFromPattern.matcher(call.getName()); if (matcher.find()) { // convert function call to ConvertExpression ConvertExpression convert = new ConvertExpression(ConvertExpression.CONVERT_FROM, matcher.group(1), call.args.get(0), call.getPosition()); return visitConvertExpression(convert, valueArg); } return false; }
@Override public Void visitConvertExpression(ConvertExpression e, StringBuilder sb) throws RuntimeException { sb.append(e.getConvertFunction()).append("("); e.getInput().accept(this, sb); sb.append(", '").append(e.getEncodingType()).append("')"); return null; }
@Override public Boolean visitConvertExpression(ConvertExpression e, IdentityHashMap<LogicalExpression, Object> value) throws RuntimeException { return e.getInput().accept(this, value); }
public static LogicalExpression createConvert(String function, String conversionType, LogicalExpression expr, ExpressionPosition ep) { return new ConvertExpression(function, conversionType, expr, ep); }
@Override public Boolean visitConvertExpression(ConvertExpression e, LogicalExpression valueArg) throws RuntimeException { if (ConvertExpression.CONVERT_FROM.equals(e.getConvertFunction())) { String encodingType = e.getEncodingType(); int prefixLength; if (e.getInput() instanceof FunctionCall) { FunctionCall call = (FunctionCall)e.getInput(); String functionName = call.getName(); if (!functionName.equalsIgnoreCase("byte_substr")) { if (e.getInput() instanceof SchemaPath) { ByteBuf bb = null; switch (encodingType) { case "UTF8": return e.getInput().accept(this, valueArg); default: bb = getByteBuf(valueArg, encodingType); this.path = (SchemaPath)e.getInput(); return true;
@Override public Boolean visitConvertExpression(ConvertExpression e, ErrorCollector value) throws RuntimeException { return e.getInput().accept(this, value); }
@Override public Boolean visitFunctionCall(FunctionCall call, LogicalExpression valueArg) { Matcher matcher = convertFromPattern.matcher(call.getName()); if (matcher.find()) { // convert function call to ConvertExpression ConvertExpression convert = new ConvertExpression(ConvertExpression.CONVERT_FROM, matcher.group(1), call.args.get(0), call.getPosition()); return visitConvertExpression(convert, valueArg); } return false; }
@Override public Void visitConvertExpression(ConvertExpression e, ErrorCollector value) throws RuntimeException { return e.getInput().accept(this, value); }
@Override public Boolean visitConvertExpression(ConvertExpression e, ErrorCollector errors) throws RuntimeException { return e.getInput().accept(this, errors); }