@Override public Expression create(List<Expression> children, StatementContext context) throws SQLException { QueryServices services = context.getConnection().getQueryServices(); boolean useByteBasedRegex = services.getProps().getBoolean(QueryServices.USE_BYTE_BASED_REGEX_ATTRIB, QueryServicesOptions.DEFAULT_USE_BYTE_BASED_REGEX); if (useByteBasedRegex) { return new ByteBasedRegexpSplitFunction(children); } else { return new StringBasedRegexpSplitFunction(children); } } }
private String[] testExpression(String srcStr, String patternStr, SortOrder sortOrder) throws SQLException { Expression srcExp, patternExp; srcExp = LiteralExpression.newConstant(srcStr, TYPE, sortOrder); patternExp = LiteralExpression.newConstant(patternStr, TYPE, sortOrder); List<Expression> expressions = Lists.newArrayList(srcExp, patternExp); String[] res1, res2; res1 = evalExp(new ByteBasedRegexpSplitFunction(expressions)); res2 = evalExp(new StringBasedRegexpSplitFunction(expressions)); testEqual(res2, res1); return res1; }
@Override public Expression create(List<Expression> children, StatementContext context) throws SQLException { QueryServices services = context.getConnection().getQueryServices(); boolean useByteBasedRegex = services.getProps().getBoolean(QueryServices.USE_BYTE_BASED_REGEX_ATTRIB, QueryServicesOptions.DEFAULT_USE_BYTE_BASED_REGEX); if (useByteBasedRegex) { return new ByteBasedRegexpSplitFunction(children); } else { return new StringBasedRegexpSplitFunction(children); } } }
@Override public Expression create(List<Expression> children, StatementContext context) throws SQLException { QueryServices services = context.getConnection().getQueryServices(); boolean useByteBasedRegex = services.getProps().getBoolean(QueryServices.USE_BYTE_BASED_REGEX_ATTRIB, QueryServicesOptions.DEFAULT_USE_BYTE_BASED_REGEX); if (useByteBasedRegex) { return new ByteBasedRegexpSplitFunction(children); } else { return new StringBasedRegexpSplitFunction(children); } } }