PREHOOK: query: DESCRIBE FUNCTION xpath_int
PREHOOK: type: DESCFUNCTION
POSTHOOK: query: DESCRIBE FUNCTION xpath_int
POSTHOOK: type: DESCFUNCTION
xpath_int(xml, xpath) - Returns an integer value that matches the xpath expression
PREHOOK: query: DESCRIBE FUNCTION EXTENDED xpath_int
PREHOOK: type: DESCFUNCTION
POSTHOOK: query: DESCRIBE FUNCTION EXTENDED xpath_int
POSTHOOK: type: DESCFUNCTION
xpath_int(xml, xpath) - Returns an integer value that matches the xpath expression
Example:
> SELECT xpath_int('12','sum(a/b)') FROM src LIMIT 1;
3
PREHOOK: query: SELECT xpath_int ('this is not a number', 'a') FROM src LIMIT 1
PREHOOK: type: QUERY
PREHOOK: Input: default@src
PREHOOK: Output: file:/Users/patrick/Documents/workspace/hive-trunk/build/ql/scratchdir/hive_2010-03-11_06-45-51_875_437569805026140503/10000
POSTHOOK: query: SELECT xpath_int ('this is not a number', 'a') FROM src LIMIT 1
POSTHOOK: type: QUERY
POSTHOOK: Input: default@src
POSTHOOK: Output: file:/Users/patrick/Documents/workspace/hive-trunk/build/ql/scratchdir/hive_2010-03-11_06-45-51_875_437569805026140503/10000
0
PREHOOK: query: SELECT xpath_int ('this 2 is not a number', 'a') FROM src LIMIT 1
PREHOOK: type: QUERY
PREHOOK: Input: default@src
PREHOOK: Output: file:/Users/patrick/Documents/workspace/hive-trunk/build/ql/scratchdir/hive_2010-03-11_06-45-57_094_9168946979271622158/10000
POSTHOOK: query: SELECT xpath_int ('this 2 is not a number', 'a') FROM src LIMIT 1
POSTHOOK: type: QUERY
POSTHOOK: Input: default@src
POSTHOOK: Output: file:/Users/patrick/Documents/workspace/hive-trunk/build/ql/scratchdir/hive_2010-03-11_06-45-57_094_9168946979271622158/10000
0
PREHOOK: query: SELECT xpath_int ('200000000040000000000', 'a/b * a/c') FROM src LIMIT 1
PREHOOK: type: QUERY
PREHOOK: Input: default@src
PREHOOK: Output: file:/Users/patrick/Documents/workspace/hive-trunk/build/ql/scratchdir/hive_2010-03-11_06-46-01_568_5764046814540785002/10000
POSTHOOK: query: SELECT xpath_int ('200000000040000000000', 'a/b * a/c') FROM src LIMIT 1
POSTHOOK: type: QUERY
POSTHOOK: Input: default@src
POSTHOOK: Output: file:/Users/patrick/Documents/workspace/hive-trunk/build/ql/scratchdir/hive_2010-03-11_06-46-01_568_5764046814540785002/10000
2147483647
PREHOOK: query: SELECT xpath_int ('try a boolean', 'a = 10') FROM src LIMIT 1
PREHOOK: type: QUERY
PREHOOK: Input: default@src
PREHOOK: Output: file:/Users/patrick/Documents/workspace/hive-trunk/build/ql/scratchdir/hive_2010-03-11_06-46-06_220_6973728860376107951/10000
POSTHOOK: query: SELECT xpath_int ('try a boolean', 'a = 10') FROM src LIMIT 1
POSTHOOK: type: QUERY
POSTHOOK: Input: default@src
POSTHOOK: Output: file:/Users/patrick/Documents/workspace/hive-trunk/build/ql/scratchdir/hive_2010-03-11_06-46-06_220_6973728860376107951/10000
0
PREHOOK: query: SELECT xpath_int ('1248', 'a/b') FROM src LIMIT 1
PREHOOK: type: QUERY
PREHOOK: Input: default@src
PREHOOK: Output: file:/Users/patrick/Documents/workspace/hive-trunk/build/ql/scratchdir/hive_2010-03-11_06-46-10_880_7033077055949838171/10000
POSTHOOK: query: SELECT xpath_int ('1248', 'a/b') FROM src LIMIT 1
POSTHOOK: type: QUERY
POSTHOOK: Input: default@src
POSTHOOK: Output: file:/Users/patrick/Documents/workspace/hive-trunk/build/ql/scratchdir/hive_2010-03-11_06-46-10_880_7033077055949838171/10000
1
PREHOOK: query: SELECT xpath_int ('1248', 'sum(a/*)') FROM src LIMIT 1
PREHOOK: type: QUERY
PREHOOK: Input: default@src
PREHOOK: Output: file:/Users/patrick/Documents/workspace/hive-trunk/build/ql/scratchdir/hive_2010-03-11_06-46-15_676_4494502415099433177/10000
POSTHOOK: query: SELECT xpath_int ('1248', 'sum(a/*)') FROM src LIMIT 1
POSTHOOK: type: QUERY
POSTHOOK: Input: default@src
POSTHOOK: Output: file:/Users/patrick/Documents/workspace/hive-trunk/build/ql/scratchdir/hive_2010-03-11_06-46-15_676_4494502415099433177/10000
15
PREHOOK: query: SELECT xpath_int ('1248', 'sum(a/b)') FROM src LIMIT 1
PREHOOK: type: QUERY
PREHOOK: Input: default@src
PREHOOK: Output: file:/Users/patrick/Documents/workspace/hive-trunk/build/ql/scratchdir/hive_2010-03-11_06-46-22_229_1539908466202895730/10000
POSTHOOK: query: SELECT xpath_int ('1248', 'sum(a/b)') FROM src LIMIT 1
POSTHOOK: type: QUERY
POSTHOOK: Input: default@src
POSTHOOK: Output: file:/Users/patrick/Documents/workspace/hive-trunk/build/ql/scratchdir/hive_2010-03-11_06-46-22_229_1539908466202895730/10000
7
PREHOOK: query: SELECT xpath_int ('1248', 'sum(a/b[@class="odd"])') FROM src LIMIT 1
PREHOOK: type: QUERY
PREHOOK: Input: default@src
PREHOOK: Output: file:/Users/patrick/Documents/workspace/hive-trunk/build/ql/scratchdir/hive_2010-03-11_06-46-28_425_5182303734060221915/10000
POSTHOOK: query: SELECT xpath_int ('1248', 'sum(a/b[@class="odd"])') FROM src LIMIT 1
POSTHOOK: type: QUERY
POSTHOOK: Input: default@src
POSTHOOK: Output: file:/Users/patrick/Documents/workspace/hive-trunk/build/ql/scratchdir/hive_2010-03-11_06-46-28_425_5182303734060221915/10000
5