TAJO-1241: Change default client and table time zone behavior. #295
Conversation
…into TAJO-1238
…into TAJO-1238
…into TZ_BUG Conflicts: tajo-client/src/main/java/org/apache/tajo/client/SessionConnection.java tajo-client/src/main/proto/ClientProtos.proto tajo-core/src/main/java/org/apache/tajo/engine/parser/SQLAnalyzer.java tajo-core/src/main/java/org/apache/tajo/master/TajoMasterClientService.java tajo-core/src/test/java/org/apache/tajo/engine/query/TestSetSessionQuery.java tajo-core/src/test/resources/results/TestSQLAnalyzer/settimezone1.result tajo-core/src/test/resources/results/TestSQLAnalyzer/settimezone2.result tajo-core/src/test/resources/results/TestSQLAnalyzer/settimezone3.result
…into TAJO-1241
throw new RuntimeException("No such session variable" + varname); | ||
void updateSessionVarsCache(Map<String, String> variables) { | ||
synchronized (sessionVarsCache) { | ||
this.sessionVarsCache.clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why all cached variables are cleared before update.
Whenever a set command is executed, a new hash map instance is passed from the client.
(Please see SetCommand.updateSessionVariable().)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because we use synchronized
feature against sessionVarsCache
. In this case, if we replace the object by another object, the synchronization will not work correctly. It will cause some concurrency problem.
Hi @hyunsik, |
+1! |
By default, TajoClient uses GMT as client time zone unless session variable TIMEZONE is specified. Also, by default Table uses GMT as table time zone unless table property timezone is specified.
This patch changes these default behavior as follows:
TimeZone.getDefault()
by default.tajo.timezone
of TajoConf by default.I also added the documentation about time zone.