In [2]:
sqlContext.sql("CREATE TEMPORARY TABLE students_table USING com.stratio.datasource.mongodb OPTIONS (host 'mongo:27017', database 'highschool', collection 'students')")
sqlContext.sql("SELECT * FROM students_table where sex='F' and Mjob='teacher' LIMIT 15").collect()
You must build Spark with Hive. Export 'SPARK_HIVE=true' and run build/sbt assembly
Py4JJavaErrorTraceback (most recent call last)
<ipython-input-2-7fe38c221b28> in <module>()
----> 1 sqlContext.sql("CREATE TEMPORARY TABLE students_table USING com.stratio.datasource.mongodb OPTIONS (host 'mongo:27017', database 'highschool', collection 'students')")
2 sqlContext.sql("SELECT * FROM students_table where sex='F' and Mjob='teacher' LIMIT 15").collect()
/usr/local/spark/python/pyspark/sql/context.pyc in sql(self, sqlQuery)
578 [Row(f1=1, f2=u'row1'), Row(f1=2, f2=u'row2'), Row(f1=3, f2=u'row3')]
579 """
--> 580 return DataFrame(self._ssql_ctx.sql(sqlQuery), self)
581
582 @since(1.0)
/usr/local/spark/python/pyspark/sql/context.pyc in _ssql_ctx(self)
681 try:
682 if not hasattr(self, '_scala_HiveContext'):
--> 683 self._scala_HiveContext = self._get_hive_ctx()
684 return self._scala_HiveContext
685 except Py4JError as e:
/usr/local/spark/python/pyspark/sql/context.pyc in _get_hive_ctx(self)
690
691 def _get_hive_ctx(self):
--> 692 return self._jvm.HiveContext(self._jsc.sc())
693
694 def refreshTable(self, tableName):
/usr/local/spark/python/lib/py4j-0.9-src.zip/py4j/java_gateway.py in __call__(self, *args)
1062 answer = self._gateway_client.send_command(command)
1063 return_value = get_return_value(
-> 1064 answer, self._gateway_client, None, self._fqn)
1065
1066 for temp_arg in temp_args:
/usr/local/spark/python/pyspark/sql/utils.pyc in deco(*a, **kw)
43 def deco(*a, **kw):
44 try:
---> 45 return f(*a, **kw)
46 except py4j.protocol.Py4JJavaError as e:
47 s = e.java_exception.toString()
/usr/local/spark/python/lib/py4j-0.9-src.zip/py4j/protocol.py in get_return_value(answer, gateway_client, target_id, name)
306 raise Py4JJavaError(
307 "An error occurred while calling {0}{1}{2}.\n".
--> 308 format(target_id, ".", name), value)
309 else:
310 raise Py4JError(
Py4JJavaError: An error occurred while calling None.org.apache.spark.sql.hive.HiveContext.
: java.lang.RuntimeException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:522)
at org.apache.spark.sql.hive.client.ClientWrapper.<init>(ClientWrapper.scala:204)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.apache.spark.sql.hive.client.IsolatedClientLoader.createClient(IsolatedClientLoader.scala:249)
at org.apache.spark.sql.hive.HiveContext.metadataHive$lzycompute(HiveContext.scala:327)
at org.apache.spark.sql.hive.HiveContext.metadataHive(HiveContext.scala:237)
at org.apache.spark.sql.hive.HiveContext.setConf(HiveContext.scala:441)
at org.apache.spark.sql.hive.HiveContext.defaultOverrides(HiveContext.scala:226)
at org.apache.spark.sql.hive.HiveContext.<init>(HiveContext.scala:229)
at org.apache.spark.sql.hive.HiveContext.<init>(HiveContext.scala:101)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:234)
at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:381)
at py4j.Gateway.invoke(Gateway.java:214)
at py4j.commands.ConstructorCommand.invokeConstructor(ConstructorCommand.java:79)
at py4j.commands.ConstructorCommand.execute(ConstructorCommand.java:68)
at py4j.GatewayConnection.run(GatewayConnection.java:209)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1523)
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.<init>(RetryingMetaStoreClient.java:86)
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:132)
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:104)
at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:3005)
at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3024)
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:503)
... 23 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1521)
... 29 more
Caused by: javax.jdo.JDOFatalDataStoreException: Failed to start database 'metastore_db' with class loader org.apache.spark.sql.hive.client.IsolatedClientLoader$$anon$1@52226d01, see the next exception for details.
NestedThrowables:
java.sql.SQLException: Failed to start database 'metastore_db' with class loader org.apache.spark.sql.hive.client.IsolatedClientLoader$$anon$1@52226d01, see the next exception for details.
at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:436)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.freezeConfiguration(JDOPersistenceManagerFactory.java:788)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.createPersistenceManagerFactory(JDOPersistenceManagerFactory.java:333)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:202)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at javax.jdo.JDOHelper$16.run(JDOHelper.java:1965)
at java.security.AccessController.doPrivileged(Native Method)
at javax.jdo.JDOHelper.invoke(JDOHelper.java:1960)
at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1166)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:808)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:701)
at org.apache.hadoop.hive.metastore.ObjectStore.getPMF(ObjectStore.java:365)
at org.apache.hadoop.hive.metastore.ObjectStore.getPersistenceManager(ObjectStore.java:394)
at org.apache.hadoop.hive.metastore.ObjectStore.initialize(ObjectStore.java:291)
at org.apache.hadoop.hive.metastore.ObjectStore.setConf(ObjectStore.java:258)
at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:73)
at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
at org.apache.hadoop.hive.metastore.RawStoreProxy.<init>(RawStoreProxy.java:57)
at org.apache.hadoop.hive.metastore.RawStoreProxy.getProxy(RawStoreProxy.java:66)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.newRawStore(HiveMetaStore.java:593)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:571)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:624)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:461)
at org.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:66)
at org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:72)
at org.apache.hadoop.hive.metastore.HiveMetaStore.newRetryingHMSHandler(HiveMetaStore.java:5762)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:199)
at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.<init>(SessionHiveMetaStoreClient.java:74)
... 34 more
Caused by: java.sql.SQLException: Failed to start database 'metastore_db' with class loader org.apache.spark.sql.hive.client.IsolatedClientLoader$$anon$1@52226d01, see the next exception for details.
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.Driver20.connect(Unknown Source)
at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:571)
at java.sql.DriverManager.getConnection(DriverManager.java:187)
at org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:78)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1148)
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
at org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.getConnection(ConnectionFactoryImpl.java:501)
at org.datanucleus.store.rdbms.RDBMSStoreManager.<init>(RDBMSStoreManager.java:298)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.datanucleus.plugin.NonManagedPluginRegistry.createExecutableExtension(NonManagedPluginRegistry.java:631)
at org.datanucleus.plugin.PluginManager.createExecutableExtension(PluginManager.java:301)
at org.datanucleus.NucleusContext.createStoreManagerForProperties(NucleusContext.java:1187)
at org.datanucleus.NucleusContext.initialise(NucleusContext.java:356)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.freezeConfiguration(JDOPersistenceManagerFactory.java:775)
... 63 more
Caused by: java.sql.SQLException: Failed to start database 'metastore_db' with class loader org.apache.spark.sql.hive.client.IsolatedClientLoader$$anon$1@52226d01, see the next exception for details.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
... 90 more
Caused by: java.sql.SQLException: Another instance of Derby may have already booted the database /home/root/metastore_db.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
... 87 more
Caused by: ERROR XSDB6: Another instance of Derby may have already booted the database /home/root/metastore_db.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.privGetJBMSLockOnDB(Unknown Source)
at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.getJBMSLockOnDB(Unknown Source)
at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
at org.apache.derby.impl.store.raw.RawStore.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
at org.apache.derby.impl.store.access.RAMAccessManager.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
at org.apache.derby.impl.db.BasicDatabase.bootStore(Unknown Source)
at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown Source)
at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Unknown Source)
... 87 more
In [ ]:
df = sqlContext.read.format('com.stratio.datasource.mongodb').options(host='mongo:27017', database='highschool', collection='students').load()
In [ ]:
df.filter(df['Mjob'] == 'teacher').take(10)
In [ ]:
view = sqlContext.sql("select * from students_table where Fjob='teacher' and romantic='yes'")
view.take(10)
In [8]:
view.write.format("com.stratio.datasource.mongodb").mode('overwrite').options(host='mongo:27017', database='highschool', collection='studentsview').save()
In [40]:
import json
def row_to_dict(row):
d = row.asDict()
id = d['_id']
return id, {key: value for key, value in d.iteritems() if key != '_id' and value and key}
view_dicts = view.select("_id", "reason").map(lambda row: row_to_dict)
In [41]:
v = view.collect()
In [42]:
items = [row_to_dict(i) for i in v]
In [47]:
es_items = sc.parallelize(items)
In [24]:
sc.setLocalProperty("es.nodes","elasticsearch")
sc.setSystemProperty("es.nodes","elasticsearch")
In [48]:
es_items.saveAsNewAPIHadoopFile(
path='-',
outputFormatClass="org.elasticsearch.hadoop.mr.EsOutputFormat",
keyClass="org.apache.hadoop.io.NullWritable",
valueClass="org.elasticsearch.hadoop.mr.LinkedMapWritable",
conf={ "es.resource" : "titanic/value_counts" ,"es.nodes": "elasticsearch"})
In [56]:
es_rdd = sc.newAPIHadoopRDD(
inputFormatClass="org.elasticsearch.hadoop.mr.EsInputFormat",
keyClass="org.apache.hadoop.io.NullWritable",
valueClass="org.elasticsearch.hadoop.mr.LinkedMapWritable",
conf={ "es.resource" : "titanic/value_counts","es.nodes": "elasticsearch"})
In [72]:
from pyspark.sql import Row
def item_to_row(item):
id, data = item
data['_id'] = id
return Row(**data)
rows = es_rdd.map(item_to_row)
es_df = rows.toDF()
es_df.registerTempTable('es_table')
In [74]:
sqlContext.sql('select * from es_table LIMIT 10').collect()
Out[74]:
[Row(Dalc=u'1', Fedu=u'4', Fjob=u'teacher', G1=u'13', G2=u'13', G3=u'13', Medu=u'4', Mjob=u'other', Pstatus=u'T', Walc=u'1', _id=u'AVUKpm9hverPzl5OEkm4', absences=u'0', activities=u'no', address=u'U', age=u'17', failures=u'0', famrel=u'4', famsize=u'GT3', famsup=u'yes', freetime=u'2', goout=u'1', guardian=u'mother', health=u'4', higher=u'yes', internet=u'no', nursery=u'yes', paid=u'no', reason=u'course', romantic=u'yes', school=u'GP', schoolsup=u'yes', sex=u'F', studytime=u'1', traveltime=u'1'),
Row(Dalc=u'2', Fedu=u'4', Fjob=u'teacher', G1=u'10', G2=u'11', G3=u'12', Medu=u'3', Mjob=u'services', Pstatus=u'T', Walc=u'2', _id=u'AVUKpm9ZverPzl5OEkmz', absences=u'0', activities=u'no', address=u'R', age=u'15', failures=u'0', famrel=u'4', famsize=u'GT3', famsup=u'yes', freetime=u'2', goout=u'2', guardian=u'father', health=u'5', higher=u'yes', internet=u'yes', nursery=u'yes', paid=u'no', reason=u'course', romantic=u'yes', school=u'GP', schoolsup=u'no', sex=u'F', studytime=u'3', traveltime=u'2'),
Row(Dalc=u'4', Fedu=u'4', Fjob=u'teacher', G1=u'7', G2=u'5', G3=u'0', Medu=u'4', Mjob=u'other', Pstatus=u'T', Walc=u'2', _id=u'AVUKpm-LverPzl5OEknB', absences=u'0', activities=u'no', address=u'R', age=u'18', failures=u'0', famrel=u'3', famsize=u'GT3', famsup=u'yes', freetime=u'2', goout=u'2', guardian=u'father', health=u'5', higher=u'yes', internet=u'yes', nursery=u'no', paid=u'no', reason=u'other', romantic=u'yes', school=u'MS', schoolsup=u'no', sex=u'F', studytime=u'2', traveltime=u'3'),
Row(Dalc=u'1', Fedu=u'4', Fjob=u'teacher', G1=u'13', G2=u'13', G3=u'13', Medu=u'4', Mjob=u'teacher', Pstatus=u'T', Walc=u'3', _id=u'AVUKpm98verPzl5OEkm-', absences=u'0', activities=u'yes', address=u'U', age=u'17', failures=u'0', famrel=u'4', famsize=u'GT3', famsup=u'yes', freetime=u'5', goout=u'5', guardian=u'mother', health=u'2', higher=u'yes', internet=u'yes', nursery=u'yes', paid=u'no', reason=u'reputation', romantic=u'yes', school=u'GP', schoolsup=u'yes', sex=u'M', studytime=u'2', traveltime=u'1'),
Row(Dalc=u'2', Fedu=u'4', Fjob=u'teacher', G1=u'18', G2=u'18', G3=u'17', Medu=u'4', Mjob=u'teacher', Pstatus=u'T', Walc=u'2', _id=u'AVUKpm98verPzl5OEkm_', absences=u'0', activities=u'no', address=u'U', age=u'18', failures=u'0', famrel=u'1', famsize=u'LE3', famsup=u'yes', freetime=u'4', goout=u'2', guardian=u'mother', health=u'1', higher=u'yes', internet=u'yes', nursery=u'yes', paid=u'no', reason=u'home', romantic=u'yes', school=u'GP', schoolsup=u'no', sex=u'M', studytime=u'1', traveltime=u'1'),
Row(Dalc=u'2', Fedu=u'4', Fjob=u'teacher', G1=u'9', G2=u'9', G3=u'8', Medu=u'4', Mjob=u'teacher', Pstatus=u'T', Walc=u'1', _id=u'AVUKpm9hverPzl5OEkm3', absences=u'16', activities=u'no', address=u'U', age=u'16', failures=u'0', famrel=u'3', famsize=u'GT3', famsup=u'yes', freetime=u'3', goout=u'2', guardian=u'mother', health=u'5', higher=u'no', internet=u'yes', nursery=u'yes', paid=u'no', reason=u'course', romantic=u'yes', school=u'GP', schoolsup=u'no', sex=u'M', studytime=u'1', traveltime=u'1'),
Row(Dalc=u'1', Fedu=u'4', Fjob=u'teacher', G1=u'13', G2=u'13', G3=u'13', Medu=u'4', Mjob=u'other', Pstatus=u'A', Walc=u'1', _id=u'AVUKpm94verPzl5OEkm8', absences=u'4', activities=u'yes', address=u'R', age=u'16', failures=u'0', famrel=u'2', famsize=u'GT3', famsup=u'yes', freetime=u'4', goout=u'3', guardian=u'mother', health=u'5', higher=u'yes', internet=u'yes', nursery=u'yes', paid=u'no', reason=u'reputation', romantic=u'yes', school=u'GP', schoolsup=u'no', sex=u'M', studytime=u'3', traveltime=u'2'),
Row(Dalc=u'5', Fedu=u'4', Fjob=u'teacher', G1=u'12', G2=u'11', G3=u'12', Medu=u'4', Mjob=u'teacher', Pstatus=u'T', Walc=u'5', _id=u'AVUKpm9nverPzl5OEkm5', absences=u'4', activities=u'yes', address=u'U', age=u'16', failures=u'0', famrel=u'4', famsize=u'GT3', famsup=u'yes', freetime=u'4', goout=u'5', guardian=u'mother', health=u'5', higher=u'yes', internet=u'yes', nursery=u'yes', paid=u'yes', reason=u'home', romantic=u'yes', school=u'GP', schoolsup=u'no', sex=u'M', studytime=u'2', traveltime=u'1'),
Row(Dalc=u'1', Fedu=u'4', Fjob=u'teacher', G1=u'12', G2=u'11', G3=u'11', Medu=u'3', Mjob=u'at_home', Pstatus=u'T', Walc=u'1', _id=u'AVUKpm9ZverPzl5OEkm0', absences=u'2', activities=u'no', address=u'R', age=u'15', failures=u'0', famrel=u'5', famsize=u'GT3', famsup=u'yes', freetime=u'3', goout=u'3', guardian=u'mother', health=u'5', higher=u'yes', internet=u'no', nursery=u'yes', paid=u'no', reason=u'course', romantic=u'yes', school=u'GP', schoolsup=u'no', sex=u'M', studytime=u'2', traveltime=u'4'),
Row(Dalc=u'1', Fedu=u'4', Fjob=u'teacher', G1=u'10', G2=u'10', G3=u'11', Medu=u'1', Mjob=u'other', Pstatus=u'T', Walc=u'2', _id=u'AVUKpm9averPzl5OEkm1', absences=u'2', activities=u'no', address=u'U', age=u'18', failures=u'0', famrel=u'3', famsize=u'GT3', famsup=u'yes', freetime=u'4', goout=u'4', guardian=u'mother', health=u'5', higher=u'yes', internet=u'no', nursery=u'no', paid=u'no', reason=u'home', romantic=u'yes', school=u'GP', schoolsup=u'yes', sex=u'F', studytime=u'2', traveltime=u'1')]
In [ ]:
Content source: anantasty/spark_ipython
Similar notebooks: