-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow both Java system properties and environment variables for HiveE…
…xternalWorkerQueryRunner The documentation https://github.com/prestodb/presto/tree/master/presto -native-execution#development says the DATA_DIR needs to be set as an environment variable, however, the dataDirectory in createJavaQueryRunner() was assigned to System.getProperty("DATA_DIR"), which gets null and causes NullPointerException. Furthermore, System.getProperty() and System.getenv() were used randomly in the native worker query runners. This is confusing and could cause more future issues. System.getProperty() reads the Java system properties that are passed in using -Dkey=value, while System.getenv() reads environment variables. They cannot be used interchangably and would return null if the corresponding values are not set. While the documentation uses environment variables, CircleCI jobs rely on system variables. In order to make the query runners more robust, it's better to support both of them. This commit introduces HiveTestUtiles.getProperty() static method to read both. If both system property and environment variable are not set, an exception would be thrown. If both of them are set but the values are different, an exception would also be thrown.
- Loading branch information
Showing
4 changed files
with
47 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters