json,table,hadoop,pigRelated issues-Collection of common programming errors
soul
plugin-development json data-sanitization
I don’t know why but it seems like wordpress is adding a second backslash when I’m using the following functions:addslashes($str_with_single_quotes) addslashes(stripslashes($str_with_single_quotes)); esc_sql($str_with_single_quotes) str_replace(“‘”, “/'”, $str_with_single_quotes)What I’m doing is that I’m fetching data from different API’s and then converting those data to a json string so I can access them later on:$item_data = array(‘item_title’ => __(addslashes(stripslashes($item_name))),’
Stian Instebo
android database json google-maps loops
Im working on an app which has google Maps in it. I want to add markers / pointers to the map. The pointers will be added from the data which is received. So if theres 3 rows in the database then it should add 3 markers to the map which the LatLng and the name of the row.I am able to add markers manually but i want it to do it in a loop. So for each row -> add an marker to the map.How can this be done?My activity is as following.public class MapsActivity extends Activity {private MainMapFragemen
Sandip Armal Patil
android json jsonexception
I am trying to make a project where i am tryin to import the datas from web server and then show then in a listview, But i am getting a error as:FATAL EXCEPTION: main java.lang.NullPointerExceptionat org.json.JSONTokener.nextCleanInternal(JSONTokener.java:112) Here is my code.package com.ku.trying;import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.HashMap; import java.util.List; im
karthikr
php arrays json object
Hi I need a help on below, I know its raised in a past but I am currently struggling to figure it out the error Cannot use object of type stdClass as array on line$score[$counter]=($bronze*$tempArray[6])+($silver*$tempArray[5])+($silver*$tempArray[4]);<?php//turning the date other way around that is why explode the date string and stored in an Array$gold=$_GET[‘gold_input’];$silver=$_GET[‘silver_input’];$bronze=$_GET[‘bronze_input’];$gdp_value=$_GET[‘gdp_checked’];$link = new mysqli(‘localhos
Mike_NotGuilty
java android json
This question already has an answer here:android.os.NetworkOnMainThreadException16 answersi’m new in Android programming. I want to read data out of a simple json. I have checked dozen of threads with answers which worked for some people. But i’m always getting a fatal error. can someone help? The JSON is from twitter.code:public class MainActivity extends Activity {/** Called when the activity is first created. */InputStream inputStream = null;String result = “”; public void onCreate(Bundle sav
user3313192
java android json android-asynctask nullpointerexception
I’m getting a FATAL EXCEPTION with a NullPointerException in line 275 of mainActivity ( Log.d(“Create Response”, json.toString());) I have referenced the object before as JSONObject json = new JSONObject(); and I’m still getting null pointer. My log cat and java code is below. Log cat :02-19 08:56:34.101: E/AndroidRuntime(1913): FATAL EXCEPTION: AsyncTask #1 02-19 08:56:34.101: E/AndroidRuntime(1913): Process: com.example.newjudoapp, PID: 1913 02-19 08:56:34.101: E/AndroidRuntime(1913): java.
user3025492
json node.js jsonlint
I’m trying to run jsonlint on a 40MB JSON file, but it halts execution with an exit status of 5, and the following error message:FATAL ERROR: JS Allocation Failed – process out of memoryDoes anyone know how I can get this JSON pretty-printed? I wonder if it has to do with node’s –max-old-space-size argument, but I’m also unsure how to pass this to the installed executable file.If there’s another approach I could take to rendering this with human-readable indentation, I’d appreciate those sugges
Mike
php json facebook-graph-api facebook-php-sdk
I have downloaded the php sdk for facebook, and am trying to retrieve a public pages statuses.In my page I have the following:require_once(“facebook.php”); $config = array(); $config[‘appId’] = ‘myID’; $config[‘secret’] = ‘mySecret’; $config[‘fileUpload’] = false; // optional $facebook = new Facebook($config); $access_token = $facebook->getAccessToken(); $ret = $facebook->api(dogfishheadbeer, statuses);//display messages foreach ($ret->data as $m) {$name = $m->name;$message = $m->
gtgaxiola
php json json-encode json-decode
I am converting an array to json from php json_enscode(). If I encode it for one array I can decode it, but when it is array(‘a’=>array(0=>array(),1=>array())) it returns {“a”:[[],[]]}When I decode it I get the following error Catchable fatal error: Object of class stdClass could not be converted to stringjson sourcethe json is here
bengo
json zend-framework doctrine2 entity
I am using Doctrine 2 and Zend framework since a few days. I am generating my entities across yaml files. Now I met an issue to convert my entities Doctrine into Json format (in order to use it through AJAX).Here is the code used : $doctrineobject = $this->entityManager->getRepository(‘\Entity\MasterProduct’)->find($this->_request->id);$serializer = new \Symfony\Component\Serializer\Serializer(array(new Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer()), array(‘json
CaptainThrills
php html table mysqli
So this is the code thats causing a headache at this time. Getting this error:Fatal error: Call to undefined method mysqli_result::execute()Not sure where I’ve done it wrong at:$mysqli_load = new mysqli(HOST, USER, PASS, DB); $query = ‘SELECT `id`, `call_taker`, `call_time`, `call_type`, `call_priority`, `call_location`, `call_city`, `reporter_name`, `reporter_num`, `call_info` FROM `calls`’; $sql = mysqli_query($mysqli_load, $query) or die($mysqli_load->error); $sql->execute() or die($mys
Sumoanand
7 modules theming table
Although i have found the fix of this problem, but i thought of sharing with others.Problem is if you mention $rows & theme_table like following:$row[] = array(‘data’ => drupal_render($form[$key][‘alt_name’]), ‘class’ => ‘alt-ing-name-td’);$output = theme_table(array(‘header’ => $header, ‘rows’ => $rows,’attributes’ => array(‘id’ => ‘recipe-id’)));then you will get following error:Fatal error: [] operator not supported for strings in theme.inc
slpcc63
table schema-api
I’m working on an .install file for my module in Drupal 7. I want to create two tables, one called tls_connect_floormap_images and one called tls_connect_floormap_coords. I’m not having any trouble with the _images table. But when I try to make the uid field of the _coords table a unique key that auto-increments, I get an error that says:Fatal error: Unsupported operand types in C:\Program Files(x86)\Zend\Apache2\htdocs\TLSConnect3App\includes\database\mysql\schema.incon line 85I get this err
rajeshwaran
android json table
Iam generating Table rows dynamically to fill with data from json my android version:4.2 here is my code:try {//HttpResponse response = httpClient.execute(httpGet, localContext);HttpResponse response = httpClient.execute(httpGet, localContext);HttpEntity entity = response.getEntity();text = getASCIIContentFromEntity(entity);//InputStream input = new BufferedInputStream( response.getEntity().getContent() );JSONArray ja = new JSONArray(text) ;// ITERATE THROUGH AND RETRIEVE CLUB FIELDSint n = ja.l
Fabien Coppens
hibernate table jpa join
I’m using Hibernate Entity Manager 3.4.0.GA with Spring 2.5.6 and MySql 5.1. I have a use case where an entity called Artifact has a reflexive many-to-many relation with itself, and the join table is quite large (1 million lines). As a result, the HQL query performed by one of the methods in my DAO takes a long time. Any advice on how to optimize this and still use HQL ? Or do I have no choice but to switch to a native SQL query that would perform a join between the table ARTIFACT and the join t
zvzej
android mysql database table cursor
I’m working in a quiz app, and at the moment I want to display my question in a text view I’m getting an error in the log and not a response in the app.here is my codemainActivity:private CuestionarioHelper db = null; private Cursor c2 = null; private int rowIndex = 1;after onCreatedb = new CuestionarioHelper(this);//EDIT ADDEDbtnVC = (Button) findViewById(R.id.btnCuestionario);btnVC.setOnClickListener(new View.OnClickListener() {public void onClick(View view) {displayCuestionario();}});and the
TNR
android table
My Android Version is:4.2Am filling Table layout dynamically from json.I have tried the following code.But it is showing me nothing.My Xml contains scrollview,table layout & textView.My .java code is: ` private class LongRunningGetIO extends AsyncTask <Void, Void, ArrayList<String>>{protected String getASCIIContentFromEntity(HttpEntity entity) throws IllegalStateException, IOException {InputStream in = entity.getContent();StringBuffer out = new StringBuffer();int n = 1;
Jitendra Kumar Singh
table hadoop external hive
Executing hive query with filter on virtual column INPUT_FILE_NAME result in following exception.hive> select count(*) from netflow where INPUT__FILE__NAME=’vzb.1351794600.0′; FAILED: SemanticException java.lang.RuntimeException: cannot find field input__file__name from [org.apache.hadoop.hive.serde2.objectinspector.UnionStructObjectInspector$MyField@1d264bf5, org.apache.hadoop.hive.serde2.objectinspector.UnionStructObjectInspector$MyField@3d44d0c6, . . . org.apache.hadoop.hive.serde2.object
Matt Dawdy
sql-server-2008 table windows-7
Our underwriting company just sent us a data extract of leads. There are 9 million rows. The rows consist of LeadID (guid), RawLeadXML (xml — probably 3-4kb max), and a LeadStatusID (int).I first tried to add an autonumber integer and make it the primary key of this table. Well, it added the field, but couldn’t make it the primary key (There is insufficient memory available in the buffer pool.)What I need to do is to take every record, 1 by 1, and get the XML, put it into an XmlDocument obje
DrStrangeLove
javascript table
Data Structurevar X = {a: [{name:”john”, phone:777},{name:”john”, phone:777},{name:”john”, phone:777}],b: [{name:”john”, phone:777},{name:”john”, phone:777},{name:”john”, phone:777}],c: [{name:”john”, phone:777},{name:”john”, phone:777},{name:”john”, phone:777}],d: [{name:”john”, phone:777},{name:”john”, phone:777},{name:”john”, phone:777}] }Functionfunction showTable(trnum,X,a) {var Tablecode = “<table><tbody>”;for (var i=0; i< X.a.length;i++) {for (var j=0; j< trnum; j++) {Ta
Ripon Al Wasim
java xml hadoop xmldocument
Getting Fatal Error while running bin/hadoop namenode -formatUsing Windows 7 operating system, Under C:\cygwin\usr\local\hadoop-0.20.203.0\conf edited hadoop-env.sh file,#export JAVA_HOME=C:/Program Files/Java/jdk1.6.0_24 export JAVA_HOME=C:/jdk1.6.0_24.I have my Java class path set to C:/jdk1.6.0_24.Fatal Error] hdfs-site.xml:5:2: The markup in the document followingthe root element must be well-formed.enter code here$ bin/hadoop namenode -format 12/02/24 07:15:38 INFO namenode.NameNode: STARTU
Mohammad Alkahtani
ubuntu cluster hadoop
I installed Hadoop on ubuntu from the .deb package when I run start-all.sh I get this error I configured the core-site.xml for hdfs:localhost:9001 but i gives me the error. I think the problem in the path of the conf dir in the hadoop-env.sh I set the path to /usr/shar/hadoop/templates/conf and tried /etc/hadoop/conf I copied the dir to this locatiob but I get the error please help me. I need it for my college project and I spent half of the semester trying to fix the problem without succesed.ER
cs_newbie
java hadoop startup fatal-error
i am starting my hadoop with 4 slaves and all works fine except for one machine. I have created them the exact same way.the error i receive when running ./start-all.sh is:xxxxx: starting tasktracker, logging to /xxxxx/xxxxx/hadoop/logs/hadoop-xxxxx-tasktracker-xxxxx.out xxxxx: /xxxxx/xxxxx/hadoop/hadoop-0.20/bin/hadoop: line 413: 7012 Aborted nohup $_JAVA_EXEC -Dproc_$COMMAND $JAVA_HEAP_MAX $HADOOP_OPTS -classpath “$CLASSPATH” $CLASS “$@” >”$_HADOOP_DAEMON_OUT” 2>&1 &l
j0k
hadoop
i am getting the following log on my namenode and its removing my datanode from execution2013-02-08 03:25:54,345 WARN namenode.NameNode (NameNodeRpcServer.java:errorReport(825)) – Fatal disk error on xxx.xxx.xxx.xxx:50010: DataNode failed volumes:/home/srikmvm/hadoop-0.23.0/tmp/current; 2013-02-08 03:25:54,349 INFO net.NetworkTopology (NetworkTopology.java:remove(367)) – Removing a node: /default-rack/xxx.xxx.xxx.xxx:50010Can anyone suggest how to rectify this ?Data Node Logs:2013-02-08 03:25:
ender
hadoop cloudera sqoop
When using the –incremental append flag in the sqoop import, the job will fail.ERROR tool.ImportTool: Imported Failed: Wrong FS: s3n://<api_key>:<api_secret>@bucket/folder/Here is the full command:sqoop import –connect jdbc:postgresql://someplace.net:12345/db –warehouse-dir s3n://<key>:<private>@bucket/folder/ –table my_table –hive-drop-import-delims –escaped-by “\\” –username root –password safepass -m 2 –split-by id –incremental append –check-column idThe ex
Nannie
java hadoop cloudera oozie hue
I’m new to Hadoop and I have the flowing problem:I keep getting a “java.lang.ClassNotFoundException” when I’m trying to run my oozzie work flow. I use the Cloudera quick start VM v 4.5. used oozzie settings:Jar name : sample.jar Main class : Driver Arguments : in_single/ outused java classpublic class Driver{ public static class TokenizerMapper extends Mapper<Object, Text, Text, Text> {@Overridepublic void map(final Object key, final Text value, final Mapper<Object, Text, Text, Text>
Alina
java spring spring-mvc hadoop hive
My application is combination of hadoop and rest service with spring framework. My aim is to provide results from hive table on request. But when I run application, after completion of mapreduce and hive job I get following error:java.lang.reflect.InvocationTargetExceptionat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
Peter Lawrey
java linux hadoop mapreduce mapper
Whether help to define mapper was executed and if it wasn’t executed, for what reason it could occur. I wrote an output of the read ways from a database to the text file of local file system on which mapper is executed. Here I give a codepackage org.myorg;import java.io.*; import java.util.*; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.logging.Level; import org.apache.hadoop.fs.*;
vpap
hadoop streaming chaining
This is a documentation on how to chain two or more streaming jobs, using Hadoop Streaming( currently 1.0.3) only and nothing more.In order to understand the final code that will do the chaining and be able to write any other chain job some preliminary but practical theory is required.First of all, what is a job in Hadoop? A Hadoop job is hadoopJob = Configuration + Executionwhere,Configuration : all the set up that makes Execution possible.Execution : the set of executable or script files t
ykesh
hadoop apache-pig
I installed hadoop-2.2.0 and can run MR jobs. Configured pig0.12 and trying to use the interactie grunt shell. But when I try to create data into records from input usingrecords = LOAD ‘/temp/temp.txt’ AS (year:chararray, temperature:int, quality:int);I get the following. Did not see this when I used pig0.12 earlier with hadoop-1.2.1 distribution.2013-11-27 11:11:37,225 [main] INFO org.apache.hadoop.conf.Configuration.deprecation – mapred.jobtracker.maxtasks.per.job is deprecated. Instead, use
MarAja
pig piglatin
In a Pig script, I am manipulating tuples of the following form:(a1:int,a2:chararray,a3:int)An example of a2 could be: “123,232,444,223,100” (Five numbers between 100 and 500 separated by commas).I would like to get the following tuple:(a1:int,u1:int,u2:int,u3:int,u4:int,u5:int,a3:int)Where u1 to u5 correspond to the values of the a2 chararray.Is it possible to do so using only pig functions?I have tried to write an UDF in Python as follows:@outputSchema(“int:u1,int:u2,int:u3,int:u4,int:u5”) def
seagaia
apache hadoop pig data-storage
I’ve been trying to get Pig 0.9.0 to run using Apache Hadoop 0.20.203.0. I’ve looked high and low over google and mailing lists and even this question: cant run pig with single node hadoop server , but I still can’t get Grunt, the Pig shell, to run in a cluster-setup (I can run the prompt fine in local mode, of course). I’ve tried the solutions given – recompiling without hadoop, adding the hadoop library and the pig-withouthadoop.jar to my PIG_CLASSPATH variable…nothing works. I just get the
BeanBagKing
java datetime pig jodatime simpledateformat
I’m working with a Pig script trying to convert a string to a datetime object using ToDate(). Here’s a sample string that I’m working with Fri Nov 01 12:30:19 EDT 2013When I try to convert it to a datetime object using ToDate(userstring, format) I get told that I’m using an invalid format…B = FOREACH A GENERATE ToDate(date,’EEE MMM dd HH:mm:ss z yyyy’) AS datetime; ERROR org.apache.pig.tools.grunt.GruntParser – ERROR 2999: Unexpected internal error. Invalid format: “Fri Nov 01 12:30:19 EDT 201
Sumod
pig
Here is my setup – Pig – 0.10 Running mode – local user – hadoop has root accessI have a file called ‘data’ with the following contents. 1 1 2 3 2 4 5 6 3 7 8 9 4 1 4 7 5 2 5 8I am following the tutorial at – http://pig.apache.org/docs/r0.10.0/basic.html#tuple-schema I am trying to read the file such that first number in each line is read as integer and rest 3 form a tuple. I am using this code – a = load ‘data’ as (f1:int, f2:tuple(t1:int, t2:int, t3:int)); But when I do ‘dump a’, I get – (1,)
FailedMathematician
hadoop pig
Please help me out… I have spent a lot of hours on this.I have files in a folder in which i wish them to be loaded according to the order of their file name.I have even went to the extend of writing Java code to convert the file names to match the format in the guides in the following links.Load multiple files in pig Pig Latin: Load multiple files from a date range (part of the directory structure) http://netezzaadmin.wordpress.com/2013/09/25/passing-parameters-to-pig-scripts/I am using pig 11
kba
hadoop mapreduce pig piglatin
I have my data in this format : student_id, course_id,grade,other_information. This is for large number of students, say billions. I have a perl script written to process data for a student. So thought of using hadoop framework to speed-up the process by streaming data of each student to the perl script.This is how i am doing:student_data = LOAD ‘source’ using PigStorage(‘\t’) As (stud_id:string,…) grp_student = group student_data by stud_id; final_data = foreach grp_student {flat_data = flatt
Glenn Slaven
pig
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
the Tin Man
mysql jdbc pig
I’m working with Pig and I’m trying to store my results in a MySQL database. Based on help that I’ve found on this site, I’m using:STORE final_data INTO ‘$dbTable’ USING org.apache.pig.piggybank.storage.DBStorage(‘com.mysql.jdbc.Driver’,’jdbc:mysql://$host:$port/$db’,’$dbUser’,’$dbPass’,’INSERT INTO $dbTable’);I’m also importing the jars (the directories are correct): piggybank.jar, mysql-connector-java-5.1.20-bin.jarHowever, I am getting the following error when I run my Pig script:[MainThread]
user2931635
regex hadoop pig
I am currently using a UDF to get an output, however a regular expression will do the same and probably quicker!I am having a problem running the code in pig, this is the line of code I am trying to run. data = FOREACH f GENERATE FLATTEN(REGEX EXTRACT(col4,'(?:\.)([^\.]*\.?[^\.]*)$’)) AS (url:chararray) ;This line of code comes up with an error Syntax error, unexpected symbol at or near ‘(‘The regex works by getting google.co.uk and will return .co.uk, google.com will return .com Link here: http
YuliaPro
pig piglatin
I have a pig script where in the beginning I would like to generate a string of the dates of the past 7 days from a certain date (later used to retrieve log files for those days). I attempt to do this with this line:%declare CMD7 input= ; for i in {1..6}; do d=$(date -d “$DATE -i days” “+%Y-%m-%d”); input=”\$input\$d,”; done; echo \$inputI get an error :” ERROR 2999: Unexpected internal error. Error executing shell command: input= ; for i in {1..6}; do d=$(date -d “2012-07-10 -i days” “+%Y-%m
Web site is in building