Redshift:500310无效操作

时间:2019-07-17 16:04:01

标签: amazon-web-services amazon-redshift

我正在使用talend将数据插入Amazon Redshift上的表中。 talend产生了Java代码,但是Amazon Redshift不支持today()函数。

我正在尝试从Salesforce加载表,并使用talend将其放入Redshift。当我从talend运行作业时,出现以下错误:

Exception in component tRedshiftOutput_1
java.sql.SQLException: [Amazon](500310) Invalid operation: function today() does not exist;
    at com.amazon.redshift.client.messages.inbound.ErrorResponse.toErrorException(ErrorResponse.java:1830)
    at com.amazon.redshift.client.PGMessagingContext.handleErrorResponse(PGMessagingContext.java:804)
    at com.amazon.redshift.client.PGMessagingContext.handleMessage(PGMessagingContext.java:642)
    at com.amazon.jdbc.communications.InboundMessagesPipeline.getNextMessageOfClass(InboundMessagesPipeline.java:312)
    at com.amazon.redshift.client.PGMessagingContext.doMoveToNextClass(PGMessagingContext.java:1062)
    at com.amazon.redshift.client.PGMessagingContext.getErrorResponse(PGMessagingContext.java:1030)
    at com.amazon.redshift.client.PGClient.handleErrorsScenario3(PGClient.java:2481)
    at com.amazon.redshift.client.PGClient.handleErrors(PGClient.java:2346)
    at com.amazon.redshift.client.PGClient.directExecute(PGClient.java:1098)
    at com.amazon.redshift.client.PGClient.directExecuteExtraMetadata(PGClient.java:1167)
[FATAL]: dw.create_invoice_0_1.create_invoice - tRedshiftOutput_1 [Amazon](500310) Invalid operation: function today() does not exist;
    at com.amazon.redshift.dataengine.PGQueryExecutor.execute(PGQueryExecutor.java:210)
    at com.amazon.jdbc.common.SStatement.executeNoParams(Unknown Source)
    at com.amazon.jdbc.common.SStatement.execute(Unknown Source)
    at dw.create_invoice_0_1.create_invoice.tSalesforceInput_1Process(create_invoice.java:4691)
    at dw.create_invoice_0_1.create_invoice.tSalesforceConnection_1Process(create_invoice.java:694)
    at dw.create_invoice_0_1.create_invoice.runJobInTOS(create_invoice.java:8761)
Caused by: com.amazon.support.exceptions.ErrorException: [Amazon](500310) Invalid operation: function today() does not exist

Amazon Redshift似乎不支持today()功能。

我想知道如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

您可以改用CURRENT_DATE函数。您可以在Redshift日期和时间功能文档中找到更多信息:https://docs.aws.amazon.com/redshift/latest/dg/Date_functions_header.html