By using AWS re:Post, you agree to the Terms of Use

Questions tagged with Amazon Redshift

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

Redshift serverless: error while trying to create an external table

The error: ``` > SQL Error [500310] [XX000]: [Amazon](500310) Invalid operation: Unknown std exception when calling external catalog API: ----------------------------------------------- error: The requested role arn:aws:iam::*******:role/service-role/AWSGlueServiceRole-analytics is not associated to cluster code: 30000 context: query: 0 location: xen_aws_credentials_mgr.cpp:403 process: padbmaster [pid=16004] ----------------------------------------------- ; ``` I was able to create a schema prior to creating external table, with no errors: ``` create external schema rsqa from data catalog database 'actions' region 'us-west-2' iam_role 'arn:aws:iam::**********:role/service-role/AWSGlueServiceRole-analytics'; ``` But after that, this is the sql that produces the error above: ``` create external table dev.rsqa.user_actions( event_id varchar(256), api_key varchar(32), event_type varchar(32), action_id INT8, action_name varchar(128), action_data_id INT8, action_time INT4, create_time INT4, metadata varchar(256), user_id INT8, username varchar(256), user_first_name varchar(128), user_last_name varchar(128), value FLOAT4, passive BOOL ) PARTITIONED BY ( ics varchar(32), site_id varchar(32), year varchar(32), month varchar(32), week varchar(32), dt varchar(32) ) stored as parquet location 's3://my-datalake-qa/actions/user_actions/'; ``` does redshift serverless support external tables? or could this be due to another setting I am missing?
2
answers
0
votes
175
views
asked 3 months ago

Not able to abort redshift connection - having a statement in waiting state

At certain point of time, all java threads which abort the redshift db connections get blocked in the service. Thread dump: ``` thread-2" #377 prio=5 os_prio=0 cpu=23073.41ms elapsed=1738215.53s tid=0x00007fd1c413a000 nid=0x5a1f waiting for monitor entry [0x00007fd193dfe000] java.lang.Thread.State: BLOCKED (on object monitor) at com.amazon.jdbc.common.SStatement.close(com.foo.drivers.redshift@1.2.43.1067/Unknown Source) - waiting to lock <0x00000006086ac800> (a com.amazon.redshift.core.jdbc42.PGJDBC42Statement) at com.amazon.jdbc.common.SConnection.closeChildStatements(com.foo.drivers.redshift@1.2.43.1067/Unknown Source) at com.amazon.jdbc.common.SConnection.closeChildObjects(com.foo.drivers.redshift@1.2.43.1067/Unknown Source) at com.amazon.jdbc.common.SConnection.abortInternal(com.foo.drivers.redshift@1.2.43.1067/Unknown Source) - locked <0x0000000607941af8> (a com.amazon.redshift.core.jdbc42.S42NotifiedConnection) at com.amazon.jdbc.jdbc41.S41Connection.access$000(com.foo.drivers.redshift@1.2.43.1067/Unknown Source) at com.amazon.jdbc.jdbc41.S41Connection$1.run(com.foo.drivers.redshift@1.2.43.1067/Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@11.0.9.1/ThreadPoolExecutor.java:1128) at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@11.0.9.1/ThreadPoolExecutor.java:628) at java.lang.Thread.run(java.base@11.0.9.1/Thread.java:829) ``` These are blocked on the threads which are still running statement on these connections. ``` thread-366" #23081 daemon prio=5 os_prio=0 cpu=972668.98ms elapsed=1553882.44s tid=0x00007fd1642b3000 nid=0x73ff waiting on condition [0x00007fd1920ac000] java.lang.Thread.State: TIMED_WAITING (parking) at jdk.internal.misc.Unsafe.park(java.base@11.0.9.1/Native Method) - parking to wait for <0x00000006086ae350> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.parkNanos(java.base@11.0.9.1/LockSupport.java:234) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(java.base@11.0.9.1/AbstractQueuedSynchronizer.java:2123) at java.util.concurrent.ArrayBlockingQueue.poll(java.base@11.0.9.1/ArrayBlockingQueue.java:432) at com.amazon.jdbc.communications.InboundMessagesPipeline.validateCurrentContainer(com.foo.drivers.redshift@1.2.43.1067/Unknown Source) at com.amazon.jdbc.communications.InboundMessagesPipeline.getNextMessageOfClass(com.foo.drivers.redshift@1.2.43.1067/Unknown Source) at com.amazon.redshift.client.PGMessagingContext.doMoveToNextClass(com.foo.drivers.redshift@1.2.43.1067/Unknown Source) at com.amazon.redshift.client.PGMessagingContext.getReadyForQuery(com.foo.drivers.redshift@1.2.43.1067/Unknown Source) at com.amazon.redshift.client.PGMessagingContext.closeOperation(com.foo.drivers.redshift@1.2.43.1067/Unknown Source) at com.amazon.redshift.dataengine.PGAbstractQueryExecutor.close(com.foo.drivers.redshift@1.2.43.1067/Unknown Source) at com.amazon.jdbc.common.SStatement.replaceQueryExecutor(com.foo.drivers.redshift@1.2.43.1067/Unknown Source) at com.amazon.jdbc.common.SStatement.executeNoParams(com.foo.drivers.redshift@1.2.43.1067/Unknown Source) at com.amazon.jdbc.common.SStatement.execute(com.foo.drivers.redshift@1.2.43.1067/Unknown Source) - locked <0x00000006086ac800> (a com.amazon.redshift.core.jdbc42.PGJDBC42Statement) ``` Statement executed in these threads : `statement.execute(“SHOW SEARCH_PATH”);` Once the java service is restarted, it works fine. But after a few days, this issue comes up again. Q1 a. Why a close connection thread is blocked even if its child statement is in a queued state? Q1 b. Is there a way to force close the connection? Q2 Why are the child statement in the waiting state?
1
answers
0
votes
41
views
asked 3 months ago
1
answers
0
votes
226
views
asked 4 months ago