[
https://issues.apache.org/jira/browse/METRON-586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15718301#comment-15718301
]
ASF GitHub Bot commented on METRON-586:
---------------------------------------
Github user nickwallen commented on a diff in the pull request:
https://github.com/apache/incubator-metron/pull/370#discussion_r90759556
--- Diff:
metron-platform/metron-common/src/test/java/org/apache/metron/common/stellar/StellarTest.java
---
@@ -593,6 +595,39 @@ public void testStringFunctions_advanced() throws
Exception {
}
@Test
+ public void testLeftRightFills() throws Exception{
+ final Map<String, Object> variableMap = new HashMap<String, Object>()
{{
+ put("foo", null);
+ put("bar", null);
+ put("notInt","oh my");
+ }};
+
+ Object left = run("FILL_LEFT('123','X', 10)",new HashedMap());
+ Object right = run("FILL_RIGHT('123','X', 10)", new HashedMap());
+ Object same = run("FILL_RIGHT('123','X', 3)", new HashedMap());
+ Object nullIn = run("FILL_RIGHT('123',foo,bar)", variableMap);
+ Object notInt= run("FILL_RIGHT('123',foo, notInt)", variableMap);
--- End diff --
Would it make sense to add more tests for the failure behavior? Like nulls
for the length and fill arguments. Also the case where the actual length is
greater than the fill length. There's probably some other corner cases we could
hit too.
> STELLAR should have FILL_LEFT and FILL_RIGHT functions
> ------------------------------------------------------
>
> Key: METRON-586
> URL: https://issues.apache.org/jira/browse/METRON-586
> Project: Metron
> Issue Type: Improvement
> Affects Versions: 0.3.0
> Reporter: Otto Fowler
>
> Stellar should support functions for filling string fields, left or right
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)