()
| 198 | } |
| 199 | |
| 200 | @Test |
| 201 | public void testZoneDST() throws Exception { |
| 202 | String defaultDTZ = "America/New_York"; // a timezone that uses DST |
| 203 | pigServerLocal.getPigContext().getProperties().setProperty("pig.datetime.default.tz", defaultDTZ); |
| 204 | pigServerLocal.registerQuery("a = load '" |
| 205 | + Util.encodeEscape(Util.generateURI(tmpFile.toString(), pigServerLocal.getPigContext())) |
| 206 | + "' as (test:datetime);"); |
| 207 | pigServerLocal.registerQuery("b = filter a by test > ToDate('2014-01-01T00:00:00.000');"); |
| 208 | pigServerLocal.registerQuery("c = foreach b generate ToString(test, 'Z') as tz;"); |
| 209 | Iterator<Tuple> actualItr = pigServerLocal.openIterator("c"); |
| 210 | |
| 211 | Tuple est = actualItr.next(); |
| 212 | assertEquals(Util.buildTuple("-0500"), est); |
| 213 | Tuple edt = actualItr.next(); |
| 214 | assertEquals(Util.buildTuple("-0400"), edt); |
| 215 | } |
| 216 | |
| 217 | private static Iterator<Tuple> generateExpectedResults(DateTimeZone dtz) |
| 218 | throws Exception { |
nothing calls this directly
no test coverage detected