amazon-redshift Questions

1

In PostgreSQL, you can use the funtion pg_typeof() within the SELECT statement to get the data type of a value returned by a SQL query. This function does not exist in Redshift, despite Redshift's ...
Montiel asked 1/7, 2020 at 20:20

1

Solved

I have a procedure that returns a recordset using the cursor method: CREATE OR REPLACE PROCEDURE myschema.permissions_sp(rs_out INOUT refcursor) LANGUAGE plpgsql SECURITY DEFINER AS $$ BEGIN OPE...

5

Solved

My S3 file (s3://MY_s3/stage/my_s3_file) has a partition on load_dt: S3 Structure: -MY_S3 --stage ---my_s3_file ----load_dt=2016-02-01 ----000024 ----load_dt=2016-02-02 ----000036 The act...
Dolliedolloff asked 15/4, 2016 at 21:28

5

Solved

I am using this query to get the aggregated results: select _bs, string_agg(_wbns, ',') from bag group by 1; I am getting this error: Error running query: function string_agg(character varyin...
Heterosexual asked 19/9, 2018 at 12:26

3

I've a database table I'd like to return all values where a column contains a non ASCII character anywhere in the string. Is there an easy way to do this? I've tried this select col_name, regexp...
Houchens asked 7/9, 2016 at 16:50

6

Solved

I am copying data from Amazon S3 to Redshift. During this process, I need to avoid the same files being loaded again. I don't have any unique constraints on my Redshift table. Is there a way to imp...

5

Is there a way to change the column ordering in Amazon Redshift (or Postgres, since it is based on it)? Or maybe add a column at a specific position? In mysql there you can do: ALTER TABLE MY_TA...
Tosha asked 23/4, 2015 at 10:18

1

Solved

I'd like to do following athena query with redshift, but so far it's been impossible to reproduce it. The query should be called in a CREATE TABLE AS () statement, so generate_sequence() ideas migh...
Thallophyte asked 9/12, 2021 at 13:21

2

Solved

I often see the leader node of our Redshift cluster peak at 100% CPU. I've identified one possible cause for this: many concurrent queries, and so many execution plans for the leader to calculate. ...
Dingo asked 14/10, 2019 at 8:19

3

I'm trying to replicate data from a read replica of RDS Postgres to Amazon redshift using Amazon's Data Migration Service. I was successfully able to perform migration tasks on the same source and...
Lanilaniard asked 9/7, 2017 at 16:0

7

Solved

I have a dataframe in Python. Can I write this data to Redshift as a new table? I have successfully created a db connection to Redshift and am able to execute simple sql queries. Now I need to writ...
Tasso asked 15/7, 2016 at 18:33

9

I'm trying to run a query in redshift where I'm selecting using json_extract_path_text. Unfortunately, some of the JSON entries in this database column are invalid. What happens: When the query h...
Wyler asked 14/8, 2014 at 21:14

2

I have a column of dates in a Redshift table. I would like the output to be in the form of unix timestamps. Essentially, I want the opposite of this question: How to convert epoch to datetime redsh...
Tagalog asked 9/6, 2017 at 15:50

3

Solved

I have a file in S3 with columns like CustomerID CustomerName ProductID ProductName Price Date Now the existing SQL table structure in Redshift is like Date CustomerID ProductID Price Is ther...
Viniculture asked 22/8, 2016 at 9:26

1

I'm dealing with a table of user subscriptions info, where each row is a specific user along with the start date of their subscription and how many months they have pre-paid. I'm trying to break th...
Maintopmast asked 9/11, 2021 at 6:13

2

I am trying to run a copy command which loads around 100 GB of data from S3 to redshift. I am using the lambda function to initiate this copy command every day. This is my current code from datetim...
Photophilous asked 27/11, 2020 at 14:3

1

I'm trying to find a way to create a user that will have read-only access to ALL the existing and newly created schemas in Redshift. Is that possible?
Astrea asked 17/10, 2021 at 11:26

4

Solved

I'am using sqlalchemy and psycopg2 to connect python to redshift. engine = create_engine('postgresql://user:password@hostname:port/database_name') I want to avoid using my password to connect to...
Mccarty asked 29/5, 2017 at 13:1

6

I'm trying to get a cumulative count of distinct objects in Redshift over a time series. The straightforward thing would be to use COUNT(DISTINCT myfield) OVER (ORDER BY timefield DESC ROWS UNBOUND...
Firenew asked 26/11, 2013 at 7:26

3

Solved

I read the document that both for data analysis and in cluster structure but I don't understand what use case different. Amazon Elasticsearch is a popular open-source search and analytics engine ...
Snitch asked 22/5, 2016 at 15:12

4

Solved

I need to create an empty time table series for a report so I can left join activity from several tables to it. Every hour of the day does not necessarily have data, but I want it to show null or z...
Supersensible asked 29/7, 2016 at 20:46

8

Solved

When I run the SQL Query: select generate_series(0,g) from ( select date(date1) - date(date2) as g from mytable ; It returns an error: INFO: Function "generate_series(integer,integer)" not s...
Angevin asked 31/3, 2014 at 11:5

4

Team, I am using redshift version *(8.0.2 ). while loading data using COPY command, I get an error: - "String contains invalid or unsupported UTF8 codepoints, Bad UTF8 hex sequence: bf (error 3)"....
Fries asked 1/3, 2014 at 3:49

1

Having a very weird problem with Glue. Using it to run some ETL on data I'm moving from MySQL RDS to Redshift. Using the same code I used on another table, where it worked fine and copied all the d...
Arianaariane asked 31/1, 2019 at 19:39

6

Solved

I have a table with some columns a,b, i need to add a custom column c_avg which will have the value c_avg = a*100/b upto 2 decimal values my original table is some thing like this id a b 1 1 2 2 ...
Guaiacol asked 5/2, 2014 at 14:45

© 2022 - 2024 — McMap. All rights reserved.