Member since
01-20-2017
29
Posts
0
Kudos Received
0
Solutions
04-14-2017
06:33 PM
I am trying to convert a text file to DataFrame. I found using following method instead of case class. But where is the data type for each field is defined if we go by this method. val people = sc.textFile("file:/home/edureka/dmishra/people.txt")
val schemaString = "name age"
import org.apache.spark.sql.Row;
import org.apache.spark.sql.types.{StructType,StructField,StringType};
val schema =
StructType(
schemaString.split(" ").map(fieldName => StructField(fieldName, StringType, true)))
val rowRDD = people.map(_.split(",")).map(p => Row(p(0), p(1).trim))
val peopleDataFrame = sqlContext.createDataFrame(rowRDD, schema)
peopleDataFrame.registerTempTable("people")
val results = sqlContext.sql("select name,age from people")
val r = results.map(t => "Name: " + t(0) + "Age : " + t(1)).collect().foreach(println scala> results.dtypes.foreach(println) (name,StringType) (age,StringType) Where is the data type assigned for data frame. How to define age as integer data type in this case or if there is a date field, where to define it. Thanks
... View more
Labels:
- Labels:
-
Apache Spark
04-03-2017
09:17 PM
Hi, I was able to connect Hue . Now I launched cloudera express. I was able to open cloudera manager. Now when clikcing on hue tab on web browser, the page comming back with message as unable to connect. Unable to connect
... View more
Labels:
- Labels:
-
Cloudera Hue
03-21-2017
06:03 PM
Can you please give me the steps without going to Cloudera Manager. I am not opening cloudera manager as I have less amount of Ram. Thanks
... View more
03-21-2017
11:33 AM
Hi, How to purge the map reduce logs that is getting created as per my Programs and Application. I executed so Oozie Jobs, Where are those logs getting created and how do I purge the old logs. Thanks
... View more
Labels:
- Labels:
-
Apache Oozie
-
Apache Sqoop
03-17-2017
03:18 PM
Hi , I am trying to execute the oozie script to execute Sqoop command. I am getting error as Error: E0701 : E0701: XML schema error, cvc-complex-type.2.4.a: Invalid content was found starting with element 'job-traker'. One of '{"uri:oozie:sqoop-action:0.2":job-tracker}' is expected Here is my code. <?xml version="1.0" encoding="UTF-8"?>
<workflow-app name="sample-wf" xmlns="uri:oozie:workflow:0.1">
<start to="myfirstsqoopjob"/>
<action name="myfirstsqoopjob">
<sqoop xmlns="uri:oozie:sqoop-action:0.2">
<job-traker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<prepare>
<delete path="${nameNode}/user/cloudera/data/emp_sal"/>
</prepare>
<configuration>
<property>
<name>mapred.compress.map.output</name>
<value>true</value>
</property>
</configuration>
<command>sqoop import --connect jdbc:mysql://localhost/test --table emp_sal --username root --password cloudera --target-dir /user/cloudera/data/emp_sal --delete-target-dir -m 1 --fields-terminated-by ','
</command>
</sqoop>
<ok to="end"/>
<error to="fail"/>
</action>
<kill name="fail">
<message>Sqoop action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end"/>
</workflow-app> what is error here with job tracker line.
... View more
Labels:
- Labels:
-
Apache Oozie
-
Apache Sqoop
03-17-2017
10:18 AM
Thank you for your reply. When I am installing the cloudera VM, I think all the settings are already configured. I restarted the all of the service and Cloudera management service. Then I I think my cloudera vm got this error. What is the command or what service I need to fix , so I can resolve my issue. Thanks
... View more
03-17-2017
09:04 AM
Thank you for your reply. When I am installing the cloudera VM, I think all the settings are already configured. I restarted the all of the service and Cloudera management service. Then I I think my cloudera vm got this error. What is the command or what service I need to fix , so I can resolve my issue. Thanks
... View more
03-16-2017
11:05 AM
I just installed Cloudera 5.8 Quickstart VM. Now I am trying to create a directory under hdfs in /user folder. I executed hdfs dfs -mkdir /user/dmishra I am getting error as [cloudera@quickstart ~]$ hdfs dfs -mkdir /user/dmishra mkdir: Cannot create directory /user/dmishra. Name node is in safe mode. some time I get mkdir: Permission denied: user=cloudera, access=WRITE, inode="/user":hdfs:supergroup:drwxr-xr-x Ho do I make all the service are good in Cloudera VM. Also I ant to know how do I insert an Image that is saved in my computer so that I could display the service running in VM
... View more
Labels:
- Labels:
-
HDFS
03-05-2017
10:44 AM
I changed the system setting to 2 CPU and started Cloudera Express(Free) and then started cloudera Manager. Thank you for solution.
... View more