Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres: ERROR: type "string" does not exist #176

Closed
shietpas opened this issue Jul 31, 2019 · 3 comments
Closed

Postgres: ERROR: type "string" does not exist #176

shietpas opened this issue Jul 31, 2019 · 3 comments
Labels
bug Something isn't working
Milestone

Comments

@shietpas
Copy link

Describe the bug
I have a pre-aggregate defined as an External Rollup, where Postgres is the database type for pre-aggregations. When cube.js attempts to create the pre-aggregate table, it defines some fields as data type "String", which is not supported in Postgres. Similar to following
CREATE TABLE stb_pre_aggregations.my_dimension_and_date_pavk001m_lhrjued2_1564600063903 ("myCol1" STRING, "myCol2" STRING, "myMeasure" FLOAT)"

Exception: textPayload: "{"message":"Error querying db","query":"SELECT xxxx","params":["2019-01-01T00:00:00Z","2019-12-31T23:59:59Z"],"error":"Error: type "string" does not exist\n at QueryQueue.parseResult (/srv/node_modules/@cubejs-backend/query-orchestrator/orchestrator/QueryQueue.js:75:13)\n at QueryQueue.executeInQueue (/srv/node_modules/@cubejs-backend/query-orchestrator/orchestrator/QueryQueue.js:64:19)\n at \n at process._tickDomainCallback (internal/process/next_tick.js:229:7)"}"
timestamp: "2019-07-31T19:08:12.527Z"

To Reproduce
Steps to reproduce the behavior:

  1. Define cube schema using Big Query as primary database type
  2. Define pre-aggregate with "external: true" for External Rollup
  3. Define external database type to be Postgres
  4. Run query that would result in pre-aggregate creation

Expected behavior
Table should be created in Postgres under stb_pre_aggregations schema that reflects pre-aggregation table using valid Postgres data types.

Screenshots
If applicable, add screenshots to help explain your problem.

Version:
0.10.16

Additional context
Using serverless-google-cloudfunctions

@paveltiunov
Copy link
Member

@paveltiunov paveltiunov added the bug Something isn't working label Aug 1, 2019
@shietpas
Copy link
Author

shietpas commented Aug 1, 2019

@paveltiunov I assume this means overriding the fromGenericType method in the PostgresDriver.js file. Can I edit that in this GitHub project (fork/PR)? I'm not familiar with how that ends up in npm under @cubejs-backend/postgres-driver package.

@paveltiunov
Copy link
Member

@shietpas Yep. You can fork and then provide PR. We'll release it for npm then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants