IMPALA-4433: Always generate testdata using the same time zone setting

Before this change, testdata was generated using the
java.util.TimeZone.getDefault() TimeZone of the machine it was running
on.  This patch standardizes on "America/Los_Angeles", which matches
the existing expected results in the end-to-end tests.

Change-Id: Iaf7cc796e44e9ff64880f9ae852f40961592f279
Reviewed-on: http://gerrit.cloudera.org:8080/5058
Reviewed-by: Jim Apple <jbapple@cloudera.com>
Tested-by: Internal Jenkins
This commit is contained in:
Jim Apple
2016-11-11 12:05:30 -08:00
committed by Internal Jenkins
parent f4a5d863c3
commit 0ea4a666dc

View File

@@ -25,6 +25,7 @@ import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.TimeZone;
class TestDataGenerator {
// 2 years
@@ -152,6 +153,10 @@ class TestDataGenerator {
System.err.println("Usage: " + "TestDataGenerator BaseOutputDirectory");
}
// The TimeZone should be the same no matter what the TimeZone is of the computer
// running this code, in order to ensure the generated data is always the same.
TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles"));
// Generate AllTypes
String dirName = args[0] + "/AllTypes";
File dir = new File(dirName);