Beam SQL CURRENT_TIMESTAMP - apache-beam

My Unix Spark Server timezone is CDT but when I'm running Beam SQL CURRENT_TIMESTAMP as below it is always coming as UTC. I tried locally also but it is always displaying UTC. I want this to be CDT same as server zone in CURRENT_TIMESTAMP function. Can you please advise fix for this?
PCollection<Row> cnct = testApps
.apply(SqlTransform.query("SELECT current_timestamp as ts "
+ "FROM PCOLLECTION"));

Related

Fetch "current datetime" from Postgres Database instead of PDI server/client time using Table Input step

Fetch "current datetime" from Postgres Database instead of PDI server/client time using Table Input step.
When I use "Table Input" step to get the Postgres Timestamp, I am getting PDI server/client time.
How to get Postgres DB timestamp instead PDI Server/Client time.
, TO_CHAR(CURRENT_TIMESTAMP, 'YYYY/MM/DD HH24:MI:SS') p_to_date1
, TO_CHAR(LOCALTIMESTAMP, 'YYYY/MM/DD HH24:MI:SS') p_to_date2
, TO_CHAR(CAST(CURRENT_TIMESTAMP AS TIMESTAMP), 'YYYY/MM/DD HH24:MI:SS') p_to_date3
p_to_date1 --> 2023/02/03 11:34:54
p_to_date2 --> 2023/02/03 11:34:54
p_to_date3 --> 2023/02/03 11:34:54

Cannot usу btree_gist with distance operator on Windows

Why I can't force to work these queries:
select '2018-09-10 03:00:00+03'::timestamptz <-> '2018-09-10 03:00:00+03'::timestamptz
select * from T
order by time <-> '2018-09-10 03:00:00+03'::timestamptz
limit 1
Error: operator does not exist: timestamp with time zone <-> timestamp with time zone
I also tried to install pg_trgm.
PostgreSQL 12.2
btree_gist 1.5
Windows Server 2012 R2
What I did wrong?

Error while querying the now() in postgresql

Iam getting the below error while running the following select query select now();
conversion to class java.time.OffsetDateTime from timestamptz not supported

Solr 4.5 not saving time correctly

I have defined a date field in the Solr, I'm using DIH to populate value from DB to Solr. InsertTs value in solr always storing either 4:00:00 or 5:00:00 but the date part is stored properly.
Solr Value: 2013-11-07T05:00:00Z or 2015-05-13T04:00:00Z
DB Value: 07-11-13 02:29:53.00 PM or 07-11-13 12:00:00.00 AM
Schema.xml: INSERTTS is defined as type "date"
DIH: name="INSERTTS" column="INSERTTS"
DIH Query:
SELECT TO_DATE(TO_CHAR(INSERTTS, 'yyyy-mm-dd hh24:mi:ss'), 'yyyy-mm-dd hh24:mi:ss') AS INSERTTS FROM EMPLOYEE
InsertTs is defined as TimeStamp in the db.
Solr is Running on Tomcat server in Linux machine. Linux machine is in EDT timezone.
DB is Oracle 11g and in UTC timezone.
Issue was with JDBC driver it was not fetching time part from the date field.

Sysdate different than database date in SQL Developer

I am using SQL Developer as a client for an Oracle 11G RAC. The database server is set to Pacific Daylight Timezone (PDT) and when I query sysdate in sqlplus, it always shows the PDT time. But in SQL Developer it displays time as GMT -4.
The system date on the system where SQL Developer is running is also set to PDT, even if I changed from Central timezone. I tried to add this parameter to the SQL Developer configuration files:
AddVMOption -Duser.timezone=GMT-7
But I continue to see the following results:
From SQL Developer:
select to_char(current_date,'DD-MON-YY HH:MI:SS'), to_char(sysdate,'DD-MON-YY HH:MI:SS'), sessiontimezone from dual;
CURRENT_DATE SYSDATE SESSIONTIMEZONE
09-AUG-13 12:57:11 10-AUG-13 03:57:11 -07:00
From sqlplus:
SQL> select to_char(current_date,'DD-MON-YY HH:MI:SS'), to_char(sysdate,'DD-MON-YY HH:MI:SS'), sessiontimezone from dual;
TO_CHAR(CURRENT_DATE,'DD-MO TO_CHAR(SYSDATE,'DD-MON-YYH
SESSIONTIMEZONE
09-AUG-13 12:55:11 09-AUG-13 12:55:11 -07:00
Anyone knows how to have the same output as generated by sqlplus?
I have to schedule jobs in a production environment and I guess it is better to use sysdate instead of the current_date.