keboola / db-extractor-snowflake

MIT License
0 stars 1 forks source link

Update project structure and standards #111

Closed ondrajodas closed 3 years ago

ondrajodas commented 3 years ago

Jira - https://keboola.atlassian.net/browse/COM-629

michaljurecko commented 3 years ago

@ondrajodas lokalne mi testy podaju, vytvoril som si db podla README:

CREATE DATABASE "michal_jurecko_snowflake_extractor";
USE DATABASE "michal_jurecko_snowflake_extractor";
CREATE SCHEMA "michal_jurecko_snowflake_extractor";
CREATE WAREHOUSE "michal_jurecko_snowflake_extractor" WITH 
  WAREHOUSE_SIZE = 'XSMALL' 
  WAREHOUSE_TYPE = 'STANDARD' 
  AUTO_SUSPEND = 900 
  AUTO_RESUME = TRUE;
CREATE ROLE "michal_jurecko_snowflake_extractor";
GRANT USAGE ON WAREHOUSE "michal_jurecko_snowflake_extractor" TO ROLE "michal_jurecko_snowflake_extractor";
GRANT USAGE ON DATABASE "michal_jurecko_snowflake_extractor" TO ROLE "michal_jurecko_snowflake_extractor";
GRANT USAGE ON SCHEMA "michal_jurecko_snowflake_extractor" TO ROLE "michal_jurecko_snowflake_extractor";
GRANT SELECT ON ALL TABLES IN SCHEMA "michal_jurecko_snowflake_extractor" TO ROLE "michal_jurecko_snowflake_extractor";
GRANT SELECT ON ALL VIEWS IN SCHEMA "michal_jurecko_snowflake_extractor" TO ROLE "michal_jurecko_snowflake_extractor";
CREATE USER "michal_jurecko_snowflake_extractor" 
  PASSWORD = 'password' 
  DEFAULT_ROLE = "michal_jurecko_snowflake_extractor" 
  DEFAULT_WAREHOUSE = "michal_jurecko_snowflake_extractor" 
  DEFAULT_NAMESPACE = "michal_jurecko_snowflake_extractor"."michal_jurecko_snowflake_extractor" 
  MUST_CHANGE_PASSWORD = FALSE;
GRANT ROLE "michal_jurecko_snowflake_extractor" TO USER "michal_jurecko_snowflake_extractor";
-------------
GRANT ALL ON DATABASE "michal_jurecko_snowflake_extractor" TO ROLE "michal_jurecko_snowflake_extractor";
GRANT ALL ON SCHEMA "michal_jurecko_snowflake_extractor" TO ROLE "michal_jurecko_snowflake_extractor";
GRANT ALL ON ALL TABLES IN SCHEMA "michal_jurecko_snowflake_extractor" TO ROLE "michal_jurecko_snowflake_extractor";
GRANT ALL ON ALL VIEWS IN SCHEMA "michal_jurecko_snowflake_extractor" TO ROLE "michal_jurecko_snowflake_extractor";
GRANT ALL ON FUTURE TABLES IN SCHEMA "michal_jurecko_snowflake_extractor" TO ROLE "michal_jurecko_snowflake_extractor";
GRANT ALL ON FUTURE VIEWS IN SCHEMA "michal_jurecko_snowflake_extractor" TO ROLE "michal_jurecko_snowflake_extractor";

Na spustenie testov su potrebne aj dalsie opravnenia GRANT ALL, pridas to prosim do README?

image

(spustim este vsetky testy a poslem zoznam chyb)

ondrajodas commented 3 years ago

@webrouse zkus si ten 62. řádek přepsat na

$this->assertEquals(0, $process->getExitCode(), sprintf('error output: %s', $process->getErrorOutput()));

ať je vidět na čem to spadne

michaljurecko commented 3 years ago

@ondrajodas Pada mi to asi vsetko na SQL compilation error: Object does not exist, or operation cannot be performed. ... a nikde aj na No active warehouse selected in the current session. ... nechces si to skusit sam na prazdnom warehouse ... ja som na calle

ondrajodas commented 3 years ago

jj vyzkouším to 👍

ondrajodas commented 3 years ago

@webrouse pullni si to a zkus to znovu

ondrajodas commented 3 years ago

ještě ti tam bude chybět oprávnění pro

GRANT ALL ON SCHEMA "PUBLIC" TO ROLE "michal_jurecko_snowflake_extractor";

a to co si psal + toto jsou oprávnění jen pro testy a ne pro extractor....ale nějak to do readme dopíšu

michaljurecko commented 3 years ago

@ondrajodas jj iba pre testy, ako pisem, dal by som to ako dalsi block .. aby to nabuduce nemusel niekto iny vytvarat a hladat, idem skusit.

michaljurecko commented 3 years ago

@ondrajodas este mi spadli 2 testy:

Ta 2) vyzera, ze asi len nahodne poradie tabuliek a treba pridat ORDER BY alebo sort v PHP. Ta 1) neviem.

image

ondrajodas commented 3 years ago

upravil jsem readme: 1/ chybí env KBC_RUNID 2/ jsem fixnul řazením tabulek na výstupu - zvláštní že u mě to nedělá a na travisu taky ne :/

michaljurecko commented 3 years ago

super, idem skusit