1
처리를 위해 parkpark를 사용하여 spark-redshift 및 redshift 데이터를 쿼리하고 있습니다.[Amazon] (500310) 잘못된 작업 : Assert
작업대 등을 사용하여 적색 변이를 실행하면 쿼리가 제대로 작동합니다.하지만 spark-redshift가 s3에 데이터를 언로드 한 다음이를 검색하고 실행할 때 다음 오류가 발생합니다. 생성됩니다
py4j.protocol.Py4JJavaError: An error occurred while calling o124.save.
: java.sql.SQLException: [Amazon](500310) Invalid operation: Assert
Details:
-----------------------------------------------
error: Assert
code: 1000
context: !AmLeaderProcess -
query: 583860
location: scheduler.cpp:642
process: padbmaster [pid=31521]
-----------------------------------------------;
at com.amazon.redshift.client.messages.inbound.ErrorResponse.toErrorException(ErrorResponse.java:1830)
at com.amazon.redshift.client.PGMessagingContext.handleErrorResponse(PGMessagingContext.java:822)
at com.amazon.redshift.client.PGMessagingContext.handleMessage(PGMessagingContext.java:647)
at com.amazon.jdbc.communications.InboundMessagesPipeline.getNextMessageOfClass(InboundMessagesPipeline.java:312)
at com.amazon.redshift.client.PGMessagingContext.doMoveToNextClass(PGMessagingContext.java:1080)
at com.amazon.redshift.client.PGMessagingContext.getErrorResponse(PGMessagingContext.java:1048)
at com.amazon.redshift.client.PGClient.handleErrorsScenario2ForPrepareExecution(PGClient.java:2524)
at com.amazon.redshift.client.PGClient.handleErrorsPrepareExecute(PGClient.java:2465)
at com.amazon.redshift.client.PGClient.executePreparedStatement(PGClient.java:1420)
at com.amazon.redshift.dataengine.PGQueryExecutor.executePreparedStatement(PGQueryExecutor.java:370)
at com.amazon.redshift.dataengine.PGQueryExecutor.execute(PGQueryExecutor.java:245)
at com.amazon.jdbc.common.SPreparedStatement.executeWithParams(Unknown Source)
at com.amazon.jdbc.common.SPreparedStatement.execute(Unknown Source)
at com.databricks.spark.redshift.JDBCWrapper$$anonfun$executeInterruptibly$1.apply(RedshiftJDBCWrapper.scala:108)
at com.databricks.spark.redshift.JDBCWrapper$$anonfun$executeInterruptibly$1.apply(RedshiftJDBCWrapper.scala:108)
at com.databricks.spark.redshift.JDBCWrapper$$anonfun$2.apply(RedshiftJDBCWrapper.scala:126)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
Caused by: com.amazon.support.exceptions.ErrorException: [Amazon](500310) Invalid operation: Assert
쿼리 :
UNLOAD ('SELECT “x”,”y" FROM (select x,y from table_name where
((load_date=20171226 and hour>=16) or (load_date between 20171227 and
20171226) or (load_date=20171227 and hour<=16))) ') TO ‘s3:s3path' WITH
CREDENTIALS ‘aws_access_key_id=xxx;aws_secret_access_key=yyy' ESCAPE
MANIFEST
여기서 문제이며 내가이 문제를 해결 할 수있는 방법은 무엇.
과 같이 각 열에 명시적인 데이터 서식을 추가하십시오. 쿼리를 단순화하려고 했습니까? 당신은 대문자로 래퍼를 필요로하지 않습니다. 어설 션 오류는 일반적으로 데이터 유형을 해석하는 데 문제가있을 때 발생합니다. 예를 들어 한 부분의 열 N이 varchar이고 다른 부분의 같은 열이 정수 또는 널인 두 부분의 'union'쿼리의 경우입니다. 어쩌면 다른 노드에서 오는 데이터에 대한 어설 션 오류 일 수 있습니다. – AlexYes
실제로 내가 사용하는 쿼리는 내부 부품입니다. 외부 부품 (래퍼)은 s3.i로 언로드해야하므로 spark-redshift에서 생성됩니다. –
Workbench에서 전체 생성 된 쿼리를 사용하면 어떻게됩니까? 같은 오류를 반환합니까? – AlexYes