amazon-redshift

Trying to create a Redshift table using Python and psycopg2 but the table does not get created with no errors reported

江枫思渺然 提交于 2020-03-05 04:14:06
问题 My codes return no error but I don't see a table in Redshift...if I put "if table exist" and try to create a table I know exists it does nothing and returns no error. Take that out and it will return duplicatetable error which is odd. import boto3 import psycopg2 import sys #Assign global variables data needed to make connection to Redshift DB_NAME = '<database>' CLUSTER_IDENTIFIER = '<clusterName>' DB_USER = '<user>' ENDPOINT = '<clustername>.<randomkey>.us-east-1.redshift.amazonaws.com'

Trying to create a Redshift table using Python and psycopg2 but the table does not get created with no errors reported

不羁的心 提交于 2020-03-05 04:13:07
问题 My codes return no error but I don't see a table in Redshift...if I put "if table exist" and try to create a table I know exists it does nothing and returns no error. Take that out and it will return duplicatetable error which is odd. import boto3 import psycopg2 import sys #Assign global variables data needed to make connection to Redshift DB_NAME = '<database>' CLUSTER_IDENTIFIER = '<clusterName>' DB_USER = '<user>' ENDPOINT = '<clustername>.<randomkey>.us-east-1.redshift.amazonaws.com'

Amazon s3a returns 400 Bad Request with Spark-redshift library

一世执手 提交于 2020-03-03 04:23:53
问题 I am facing java.io.IOException: s3n://bucket-name : 400 : Bad Request error while loading Redshift data through spark-redshift library: The Redshift cluster and the s3 bucket both are in mumbai region . Here is the full error stack: 2017-01-13 13:14:22 WARN TaskSetManager:66 - Lost task 0.0 in stage 0.0 (TID 0, master): java.io.IOException: s3n://bucket-name : 400 : Bad Request at org.apache.hadoop.fs.s3native.Jets3tNativeFileSystemStore.processException(Jets3tNativeFileSystemStore.java:453)

Amazon s3a returns 400 Bad Request with Spark-redshift library

假如想象 提交于 2020-03-03 04:22:24
问题 I am facing java.io.IOException: s3n://bucket-name : 400 : Bad Request error while loading Redshift data through spark-redshift library: The Redshift cluster and the s3 bucket both are in mumbai region . Here is the full error stack: 2017-01-13 13:14:22 WARN TaskSetManager:66 - Lost task 0.0 in stage 0.0 (TID 0, master): java.io.IOException: s3n://bucket-name : 400 : Bad Request at org.apache.hadoop.fs.s3native.Jets3tNativeFileSystemStore.processException(Jets3tNativeFileSystemStore.java:453)

Redshift UDF AES ENCRYPT - No module named Crypto.Cipher._mode_ecb

╄→гoц情女王★ 提交于 2020-02-26 02:42:12
问题 LIBRARY create library pycryptodome language plpythonu from 's3://aws_python/library/pycryptodome/pycryptodome.zip' credentials 'aws_iam_role' region as 'aws-region'; FUNCTION CREATE OR REPLACE FUNCTION test.aes_encrypt(input varchar(max)) RETURNS varchar(max) STABLE AS ' if input is None: return None import pycryptodome encrypt=True secret_key = b''abcdefghijklmnop'' remainder = len(secret_key) % 16 modified_key = secret_key.ljust(len(secret_key) + (16 - remainder))[:32] remainder = len

Amazon Redshift Grants - New table can't be accessed even though user has grants to all tables in schema

孤街醉人 提交于 2020-02-19 08:39:30
问题 I have a bit of a funny situation in Amazon Redshift where I have a user X who has grant select on all tables in schema public, but once a new table is created, this grant doesn't seem to apply to the new table. Is this normal behaviour? If yes, how does one deal with it such that the schema level grants are maintained. Thank you. 回答1: In Redshift tables and views do not automatically inherit the permissions of their parent schema. Your newly created tables are only accessible to the user who

Amazon Redshift Grants - New table can't be accessed even though user has grants to all tables in schema

偶尔善良 提交于 2020-02-19 08:38:33
问题 I have a bit of a funny situation in Amazon Redshift where I have a user X who has grant select on all tables in schema public, but once a new table is created, this grant doesn't seem to apply to the new table. Is this normal behaviour? If yes, how does one deal with it such that the schema level grants are maintained. Thank you. 回答1: In Redshift tables and views do not automatically inherit the permissions of their parent schema. Your newly created tables are only accessible to the user who

Aggregate string values to a list

久未见 提交于 2020-01-30 12:01:39
问题 I am trying to work some very simple logic to transform an unpivoted column into what essentially amounts to a grouped list. However, having troubles doing this efficiently. Essentially, I have a data set that looks as follows: CUST_ID ORDER 1 Cake 1 Bread 2 Cake 3 Cake 3 Bread 3 Croissant 4 Croissant But would like to output it as follows: CUST_ID ORDERS 1 Cake 1 Bread, Cake 3 Cake, Bread, Croissant 4 Croissant I have tried subqueries (which I cannot get to work), but this seems brutal

Aggregate string values to a list

会有一股神秘感。 提交于 2020-01-30 12:00:51
问题 I am trying to work some very simple logic to transform an unpivoted column into what essentially amounts to a grouped list. However, having troubles doing this efficiently. Essentially, I have a data set that looks as follows: CUST_ID ORDER 1 Cake 1 Bread 2 Cake 3 Cake 3 Bread 3 Croissant 4 Croissant But would like to output it as follows: CUST_ID ORDERS 1 Cake 1 Bread, Cake 3 Cake, Bread, Croissant 4 Croissant I have tried subqueries (which I cannot get to work), but this seems brutal

Amazon Redshift to Mysql using Pentaho Data Integration

寵の児 提交于 2020-01-30 11:29:26
问题 We are using Amazon redshift and the data base is POSTGRESQL.Tha data sit in amazon cloud. We need to load data from Amazon redshift to Mysql using Pentaho Data Integration Software.Could you please tell us how to connect to Redshift via Pentaho ??? 回答1: I'll try to help you. The redshift connection will need the PostgreSql JDBC in the lib folder of your pentaho data-integration. But the one that comes with Pentaho have some issues with redshift, this may be solved by removing the existent