private void init() { ImmutableBytesWritable ptr = new ImmutableBytesWritable(); Expression patternExpr = getPatternExpression(); if (patternExpr.isStateless() && patternExpr.getDeterminism() == Determinism.ALWAYS && patternExpr.evaluate(null, ptr)) { String patternStr = (String) patternExpr.getDataType().toObject(ptr, patternExpr.getSortOrder()); if (patternStr != null) { pattern = compilePatternSpec(patternStr); } } // If the source string has a fixed width, then the max length would be the length // of the source string minus the offset, or the absolute value of the offset if // it's negative. Offset number is a required argument. However, if the source string // is not fixed width, the maxLength would be null. Expression offsetExpr = getOffsetExpression(); if (offsetExpr.isStateless() && offsetExpr.getDeterminism() == Determinism.ALWAYS && offsetExpr.evaluate(null, ptr)) { offset = (Integer)PInteger.INSTANCE.toObject(ptr, offsetExpr.getDataType(), offsetExpr.getSortOrder()); if (offset != null) { PDataType type = getSourceStrExpression().getDataType(); if (type.isFixedWidth()) { if (offset >= 0) { Integer maxLength = getSourceStrExpression().getMaxLength(); this.maxLength = maxLength - offset - (offset == 0 ? 0 : 1); } else { this.maxLength = -offset; } } } } }
AbstractBasePattern pattern = this.pattern; if (pattern == null) { Expression patternExpr = getPatternExpression(); if (!patternExpr.evaluate(tuple, ptr)) { return false;
private void init() { ImmutableBytesWritable ptr = new ImmutableBytesWritable(); Expression patternExpr = getPatternExpression(); if (patternExpr.isStateless() && patternExpr.getDeterminism() == Determinism.ALWAYS && patternExpr.evaluate(null, ptr)) { String patternStr = (String) patternExpr.getDataType().toObject(ptr, patternExpr.getSortOrder()); if (patternStr != null) { pattern = compilePatternSpec(patternStr); } } // If the source string has a fixed width, then the max length would be the length // of the source string minus the offset, or the absolute value of the offset if // it's negative. Offset number is a required argument. However, if the source string // is not fixed width, the maxLength would be null. Expression offsetExpr = getOffsetExpression(); if (offsetExpr.isStateless() && offsetExpr.getDeterminism() == Determinism.ALWAYS && offsetExpr.evaluate(null, ptr)) { offset = (Integer)PInteger.INSTANCE.toObject(ptr, offsetExpr.getDataType(), offsetExpr.getSortOrder()); if (offset != null) { PDataType type = getSourceStrExpression().getDataType(); if (type.isFixedWidth()) { if (offset >= 0) { Integer maxLength = getSourceStrExpression().getMaxLength(); this.maxLength = maxLength - offset - (offset == 0 ? 0 : 1); } else { this.maxLength = -offset; } } } } }
private void init() { ImmutableBytesWritable ptr = new ImmutableBytesWritable(); Expression patternExpr = getPatternExpression(); if (patternExpr.isStateless() && patternExpr.getDeterminism() == Determinism.ALWAYS && patternExpr.evaluate(null, ptr)) { String patternStr = (String) patternExpr.getDataType().toObject(ptr, patternExpr.getSortOrder()); if (patternStr != null) { pattern = compilePatternSpec(patternStr); } } // If the source string has a fixed width, then the max length would be the length // of the source string minus the offset, or the absolute value of the offset if // it's negative. Offset number is a required argument. However, if the source string // is not fixed width, the maxLength would be null. Expression offsetExpr = getOffsetExpression(); if (offsetExpr.isStateless() && offsetExpr.getDeterminism() == Determinism.ALWAYS && offsetExpr.evaluate(null, ptr)) { offset = (Integer)PInteger.INSTANCE.toObject(ptr, offsetExpr.getDataType(), offsetExpr.getSortOrder()); if (offset != null) { PDataType type = getSourceStrExpression().getDataType(); if (type.isFixedWidth()) { if (offset >= 0) { Integer maxLength = getSourceStrExpression().getMaxLength(); this.maxLength = maxLength - offset - (offset == 0 ? 0 : 1); } else { this.maxLength = -offset; } } } } }
AbstractBasePattern pattern = this.pattern; if (pattern == null) { Expression patternExpr = getPatternExpression(); if (!patternExpr.evaluate(tuple, ptr)) { return false;
AbstractBasePattern pattern = this.pattern; if (pattern == null) { Expression patternExpr = getPatternExpression(); if (!patternExpr.evaluate(tuple, ptr)) { return false;