I've got data from a SAP BW InfoProvider written to HDFS. Now I'm trying to make that data available for reporting in Vora 1.3.
I'm trying to run a statement in Vora Tools SQL console, starting with:
CREATE TABLE F002_5_F (calyear string,
calmonth string,
/bic/zfiscweek string,
doc_currcy string,
co_area string,
/bic/zbillamt decimal(17,2),
......)
USING com.sap.spark.vora
OPTIONS (.....
And upon execution Vora reports a syntax error in lines for fields with names containing "/bic/" part.
As a workaround, I tried quoting field names, e.g. "/bic/zfiscweek". But then Vora reported a syntax error in the line "USING com.sap.spark.vora".
Any comment on how field names with "/" character should be treated in Vora modelling?
Quoted column names are not supported. You have to replace the slash "/" with another character so that the column name becomes a valid SQL identifier.
Try surrounding the column names with backticks.
CREATE TABLE SLASHTABLE (`/A1` double, `/A2` int, `/A3` string)
USING com.sap.spark.vora
OPTIONS (files "/user/vora/test.csv");
This also works in SELECT queries:
SELECT `/A1` from SLASHTABLE;
Related
I'm trying to build a Log Analytics Workbook using Parameters. One of the parameters is not being recognized by the workbook.
Whats going on here?
Example:
Using {STORAGE_ACCOUNT:label} as Parameter results in:
Error: " operator:Failed to resolve table or column or scalar expression named '<storageaccountname>'...
Hardcoding <storageaccountname> in the query results in no error
when using single value parameters like {STORAGE_ACCOUNT:label}, you still need to enclose them in quotes (either single or double) to make them valid strings:
let varStorageAccount = '{STORAGE_ACCOUNT:label}';
you're doing that in the example when you hardcode the string.
when using multi-value parameters (like multiselect dropdowns), then the quote and delimiter settings are part of that parameter itself. but for single value parameters like text or single select dropdown, there's no quotes by default, so that the parameters can represent things that wouldn't normally be quoted.
I am importing a .csv file using HANA studio, this is what my table looks like:
This is what my query looks like:
select outage_start from "PIHPJ"."ji_major_storm"
and this is the error message:
SAP DBTech JDBC: [260]: invalid column name: OUTAGE_START: line 1 col 8 (at pos 7)
If I change to upper case:
select OUTAGE_START from "PIHPJ"."ji_major_storm"
I still get this error message:
SAP DBTech JDBC: [260]: invalid column name: OUTAGE_START: line 1 col 8 (at pos 7)
What’s going on??? What am I doing wrong?
That's a common challenge and there are plenty of questions and answers for it.
In short: if an object has been named with double quotation marks (" ") then the name is not converted to upper case.
To address such objects (tables, columns, views, etc.) it is necessary to use double quotation marks again.
If, for example, the column was named "outage_start", you will have to use the quotation marks and the lower case every time you use this column.
So this:
select "outage_start" from "PIHPJ"."ji_major_storm"
might work in your case.
I am completely new to Hive. While creating a Hive table, I came across following error:
>create table coffee (WINDOW int);
Error: Error while compiling statement: FAILED: ParseException line 1:23
cannot recognize input near 'WINDOW' 'int' ')' in column specification
(state=42000,code=40000)
When I digged more, I realized its happening due to reserve keyword "Window" which I have used while creating table in Hive. Can I get a list of all reserve keyword in Hive which can not be used as a column name. I got a list of reserve keywords at following link, but I am able to use lot of listed reserve keywords as column name from it while creating table.
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL
you can use backtick quotes to create tables/column with keyword names like this
create table coffee (`WINDOW` int);
Anyway, I would recommend choose a different name, if you want to select the data by column name, you will also must use the backtick quotes
You can't use reserved keywords as column name.
WINDOW is a reversed keyword. So use some other name for your variable.
Edit: use backtick quotation (``) like below:
create table coffee ( `WINDOW` int);
I am exporting tables using the following command bq extract --destination_format=CSV --compression=GZIP --noprint_header <table> <gcs>
I noticed that strings containing double quotes had double quotes appended upon export, and stumbled upon the reason in this thread: Data between quotes and field separator
It seems like there was a way to change the quote character (per Jordan's comment in the answer) at one point in the past, but I cannot seem to find it today.
Is it currently possible to specify the quote character when exporting BQ tables as CSV?
I think Jordan's comment was related to Load Jobs and not applicable for Extract Jobs
The option to try I see in your case is to replace all double quotes with single quotes (via SELECT REPLACE(field,...) ... FROM table ... with new table as destination) and then do extract for that modified table
Of course this assumes you can afford such substitution and it will not than break your product/app.
Below is simplified example of query you should run
#standardSQL
SELECT * REPLACE (REPLACE(fieldWithIssue, '"', "'") AS fieldWithIssue)
FROM yourTable
First REPLACE is part of SELECT * REPLACE feature
Whereas second REPLACE is just simple string function that replaces double quotes with single quotes
I have created a table with some columns using PL/SQL Develper to access this Oracle database.
After clicking the "Apply" button that will create the table, all my column names suddenly become upper case (which can hardly be read), including the table name!
Would that be possible to configure PL/SQL Developer IDE to leave the columns names and table names as they are?!
Oracle DBMS ignores case and translates everything to uppercase unless you use quotes. But the quotes have the liability that you always have to use them.
If you do not use the quotes you will get an error message ORA-00942: table or view does not exist
You can give column name in double quote "". Then those column name will be in as it is.