Search in sources :

Example 1 with LTrimFunction

use of org.apache.phoenix.expression.function.LTrimFunction in project phoenix by apache.

the class SortOrderExpressionTest method ltrim.

@Test
public void ltrim() throws Exception {
    List<Expression> args = Lists.newArrayList(getInvertedLiteral("   blah", PChar.INSTANCE));
    evaluateAndAssertResult(new LTrimFunction(args), "blah");
}
Also used : LTrimFunction(org.apache.phoenix.expression.function.LTrimFunction) RoundDateExpression(org.apache.phoenix.expression.function.RoundDateExpression) Test(org.junit.Test)

Example 2 with LTrimFunction

use of org.apache.phoenix.expression.function.LTrimFunction in project phoenix by apache.

the class SortOrderExpressionTest method substrLtrim.

@Test
public void substrLtrim() throws Exception {
    List<Expression> ltrimArgs = Lists.newArrayList(getInvertedLiteral("   blah", PChar.INSTANCE));
    Expression ltrim = new LTrimFunction(ltrimArgs);
    List<Expression> substrArgs = Lists.newArrayList(ltrim, getLiteral(3), getLiteral(2));
    evaluateAndAssertResult(new SubstrFunction(substrArgs), "ah");
}
Also used : LTrimFunction(org.apache.phoenix.expression.function.LTrimFunction) RoundDateExpression(org.apache.phoenix.expression.function.RoundDateExpression) ByteBasedRegexpSubstrFunction(org.apache.phoenix.expression.function.ByteBasedRegexpSubstrFunction) SubstrFunction(org.apache.phoenix.expression.function.SubstrFunction) StringBasedRegexpSubstrFunction(org.apache.phoenix.expression.function.StringBasedRegexpSubstrFunction) Test(org.junit.Test)

Aggregations

LTrimFunction (org.apache.phoenix.expression.function.LTrimFunction)2 RoundDateExpression (org.apache.phoenix.expression.function.RoundDateExpression)2 Test (org.junit.Test)2 ByteBasedRegexpSubstrFunction (org.apache.phoenix.expression.function.ByteBasedRegexpSubstrFunction)1 StringBasedRegexpSubstrFunction (org.apache.phoenix.expression.function.StringBasedRegexpSubstrFunction)1 SubstrFunction (org.apache.phoenix.expression.function.SubstrFunction)1