Pig Filter Syntax error, unexpected symbol - apache-pig

inputData = LOAD '$input' AS (line:chararray);
statusLineFilter = FILTER smallData BY (line MATHCES '^.* AppWrite-Dispatcher: Status code: [0-9]+$');
This code, when I run it, yields this error: ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: Syntax error, unexpected symbol at or near 'line'
The log file says the exact same thing. I'm at a loss, because the exact same syntax is working in other scripts I've written.

In order to avoid misspelling of key words I recommend you to use an IDE or a Text-Editor like emacs with the pig-mode.el which add syntax highlight ;)

Related

why dbt runs in cli but throws an error on cloud UI for the exact same model?

I am executing dbt run -s model_name on CLI and the task completes successfully. However, when I run the exact same command on dbt cloud, I get this error:
Syntax or semantic analysis error thrown in server while executing query.
Error message from server: org.apache.hive.service.cli.HiveSQLException:
Error running query: org.apache.spark.sql.AnalysisException: cannot
resolve '`pv.meta.uuid`' given input columns: []; line 6 pos 4;
\n'Project ['pv.meta.uuid AS page_view_uuid#249595,
'pv.user.visitorCookieId AS (80) (SQLExecDirectW)")
it looks like it fails recognizing 'pv.meta.uuid' syntax which extract data from a json format. It is not clear to me what is going on. Any thoughts? Thank you!

How to query json attributes with a space using json_extract_scalar function w/o 'INVALID_FUNCTION_ARGUMENT: Invalid JSON path' error?

json_extract_scalar(eventprops,'$.campaign id')--threw error
json_extract_scalar(eventprops,'$."campaign id"')--threw error
json_extract_scalar(eventprops,'$.""campaign id""')--threw error
json_extract_scalar(eventprops,'$."campaign id"')--threw error
json_extract_scalar(eventprops,'$.["campaign id"]')--threw error
You need to remove a dot between $ and [.
json_extract_scalar(eventprops,'$["campaign id"]')

Error loading yelp dataset to postgreSQL

I'm trying to import the Yelp data from their sql file into a postgreSQL 10 database on Windoes by running the code:
psql -U postgres yelp_db < yelp_sql
and getting the errors below. As you can see it is probably due to the ` character. Is there any way to easy fix that? The file is 7.3GB so I'd like to avoid having to read it line by line to change the ` character to '.
ERROR: syntax error at or near "PaxHeader"
LINE 1: PaxHeader/yelp_db.sql17 uid=998889796
^
ERROR: syntax error at or near "`"
LINE 1: CREATE DATABASE /*!32312 IF NOT EXISTS*/ `yelp_db` /*!40100 ...
^
ERROR: syntax error at or near "USE"
LINE 1: USE `yelp_db`;
^
ERROR: syntax error at or near "`"
LINE 1: DROP TABLE IF EXISTS `attribute`;
^
ERROR: syntax error at or near "`"
LINE 1: CREATE TABLE `attribute` (

How to debug the error thrown by Doctrine

What ?
This is the error thrown by my doctrine when writing my query
[Semantical Error] line 0, col 971 near '(\n ': Error: Class '(' is not defined.
How can i detect the exact position where the error occurs in my doctrine style of writing, in short how to read this error ?
my Query pattern
$qb1 = $this->_em->createQueryBuilder();
$qb1->select('
count(case when (boolShit) then id end)
')
->from(someTable);
$qb1->getQuery()->getResult();
Assuming that you have Symfony2, you can debug it with using app_dev.php. If you do so, you are able to press plus button beneath the error output that you've shown. This pus button is on the end of the line starting with [QueryException].
If you'll find this magic "plus button" you will find the exact line of getting result (i.e. getResult(), getArrayResult()...)
Example output with "plus button":

Syntax error when storing Pig output

I am having some issues with storing my pig output to a file. This is what I am using to store:
'STORE rel INTO 'simple'; '
If I Dump 'rel' I get:
>(car,0.5,(door,tire,jello,truck,random))
(toy,0.5,(jeep,bunny toy))
(door,0.5,(car,jello,random))
>(jeep,0.5,(toy,bunny toy))
What I get in the file is:
<Yulias-MacBook-Pro:~ yuliatolskaya$ /Users/yuliatolskaya/Documents/misc/pig_clustering/simple/part-r-00000 ; exit;
/Users/yuliatolskaya/Documents/misc/pig_clustering/simple/part-r-00000: line 1: syntax error near unexpected token `('
/Users/yuliatolskaya/Documents/misc/pig_clustering/simple/part-r-00000: line 1: `car 0.5 (door,tire,jello,truck,random)'
logout
[Process completed] >
I am really not sure what the problem is, as there are no errors in the logfiles...Please Help!