amazon-redshift Questions

7

Solved

How to find the last day os the month in postgres? I have a date columns stored as numeric(18) in the format(YYYYMMDD) I am trying it to make it date using to_date("act_dt",'YYYYMMDD') AS "act da...
Warison asked 28/1, 2015 at 6:28

3

Team, I am working on redshift ( 8.0.2 ). I would like to have DDL command in place for any object type ( table / view...) in redshift. I have below one. but it is not giving the full text. se...
Monogram asked 16/4, 2014 at 23:57

6

Solved

I like to set up tools and services with production, staging, and local development. I'd like to use Amazon Redshift, and starting at $180 a month seems pretty reasonable for a columnar store datab...
Taille asked 24/1, 2015 at 19:52

6

I have a redshift cluster that I use for some analytics application. I have incoming data that I would like to add to a clicks table. Let's say I have ~10 new 'clicks' that I want to store each sec...
Carrissa asked 22/8, 2014 at 19:42

10

I'm new to aws, can anyone tell me what are redshifts' equivalents to mysql commands? show tables -- redshift command describe table_name -- redshift command
Astereognosis asked 11/9, 2013 at 5:36

5

Solved

I tried the below: SELECT * FROM generate_series(2,4); generate_series ----------------- 2 3 4 (3 rows) SELECT * FROM generate_series(5,1,-2); generate_series ----------------- 5 3 1 (3 r...
Goods asked 21/3, 2014 at 9:7

2

I'm trying to add tags to a Redshift cluster using CreateTags, http://docs.aws.amazon.com/redshift/latest/APIReference/API_CreateTags.html and you'll notice it requires an ARN for the resource. Bu...
Sample asked 6/10, 2017 at 19:21

9

Solved

I tried to use the code suggested on the Postgresql wiki (https://wiki.postgresql.org/wiki/Retrieve_primary_key_columns): SELECT a.attname, format_type(a.atttypid, a.atttypmod) AS data_type FROM ...
Tombolo asked 1/6, 2016 at 5:14

6

I've lots of string values containing single quotes which I need to insert to a column in REDSHIFT table. I used both /' and '' to escape the single quote in INSERT statement. e.g. INSERT INTO...
Bloodshed asked 28/12, 2017 at 0:50

4

Solved

I am wondering how I can remove all newline characters in Redshift from a field. I tried something like this: replace(replace(body, '\n', ' '), '\r', ' ') and regexp_replace(body, '[\n\r]+', ' ...
Trochelminth asked 3/9, 2015 at 4:42

6

Solved

I work in dbeaver. I have a table x. TABLE x has a column "timestamp" 1464800406459 1464800400452 1464800414056 1464800422854 1464800411797 The result I want: Wed, 01 Jun 2016 17:00:...
Mesitylene asked 2/10, 2016 at 8:59

5

Solved

I am trying to count rows which have a distinct combination of 2 columns in Amazon redshift. The query I am using is - select count(distinct col1, col2) from schemaname.tablename where some filte...
Kerstinkerwin asked 24/9, 2018 at 5:41

6

I am trying to connect to redshift from my python code. my pip installed: psycopg2==2.6.1 redshift-sqlalchemy==0.4.1 SQLAlchemy==1.0.9 and my virtual machine has: libpq-dev python-psycopg2 Bu...
Moulmein asked 19/11, 2015 at 2:13

3

Solved

I have a table with column with lists like this: id [1,2,3,10] [1] [2,3,4,9] The result I would like to have is a table with unlisted values like this: id2 1 2 3 10 1 2 3 4 9 I have tried differe...
Cobham asked 24/12, 2020 at 11:2

3

Considering Sunday as the first day of the week the below statements in redshift should return 2 as the week number instead returning 1. Mysql has a function called Week() where we can use the mo...
Electra asked 8/1, 2018 at 9:30

5

Solved

Can we directly copy a table from one redshift cluster to another redshift cluster? I know table copying can be achieved using s3 as temp storage(i.e. unload to s3 from first cluster and then copy...
Elliottellipse asked 5/5, 2015 at 8:20

4

I can find a workaround, but it is really annoying and I may certainly be missing something. Redshift's ROUND function doesn't round to the number of decimals specified. For example, select round(c...
Battista asked 28/1, 2021 at 18:54

3

I am using Redshift scheduled queries to run an UNLOAD command. I would like to receive a notification if the query fails. I enabled SNS, but the message is the same regardless of if the job succee...

1

I am able to successfully schedule a redshift query, which is not very fancy. Just simple truncate and load. I also created a SNS topic and attached to this query. I am getting an email notificatio...

3

Redshift does not support Arrays, however my source database has several Array columns that I need in Redshift. How should this field type be handled when trying to migrate it into Redshift?
Unreason asked 16/7, 2016 at 16:38

7

I'm trying to connect Spark with amazon Redshift but i'm getting this error : My code is as follow : from pyspark.sql import SQLContext from pyspark import SparkContext sc = SparkContext(appN...
Tailorbird asked 11/7, 2016 at 13:0

4

I'm trying to unload a table data from postgres database into amazon s3. I'm aware that redshift has a option of unload into s3 - Since redshift is a postgres database, I tried using the same comm...

2

I'm using Amazon Redshift's JSON parsing abilities. Most of the time it works, but it fails in this case. I'm getting the following error: error: JSON parsing error code: 8001 context: invalid j...
Radiophotograph asked 19/8, 2014 at 18:38

3

Solved

I'm trying to run a query in redshift from a python script, but I'm getting error: sqlalchemy.exc.InternalError: (psycopg2.InternalError) ALTER EXTERNAL TABLE cannot run inside a transaction block...
Collyrium asked 6/7, 2017 at 22:3

7

Solved

SQL Server has the ability to declare a variable, then call that variable in a query like so: DECLARE @StartDate date; SET @StartDate = '2015-01-01'; SELECT * FROM Orders WHERE OrderDate >= @...
Photooffset asked 13/6, 2015 at 18:32

© 2022 - 2024 — McMap. All rights reserved.