Code Monkey home page Code Monkey logo

Comments (2)

Jimvin avatar Jimvin commented on July 22, 2024

from hadoop-pcap.

Jimvin avatar Jimvin commented on July 22, 2024

Tested and confirmed workaround in spark-shell.

scala> sqlContext.sql("CREATE EXTERNAL TABLE ora_pcap_sec (id bigint, ts_usec double, src string, src_port int, dst string, dst_port int, tns_auth_user string, tns_aut_app_user string, tns_auth_passwd string, tns_auth_terminal string, tns_auth_program_nm string, tns_auth_machine string) ROW FORMAT SERDE 'net.ripe.hadoop.pcap.serde.PcapDeserializer' WITH SERDEPROPERTIES('serialization.encoding'='SJIS') STORED AS INPUTFORMAT 'net.ripe.hadoop.pcap.mr1.io.PcapInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' LOCATION 'hdfs:///user/cloudera/pcap/data/'")
res6: org.apache.spark.sql.DataFrame = [result: string]

scala> val result2 = sqlContext.sql("select * from ora_pcap_sec")
result2: org.apache.spark.sql.DataFrame = [id: bigint, ts_usec: double, src: string, src_port: int, dst: string, dst_port: int, tns_auth_user: string, tns_aut_app_user: string, tns_auth_passwd: string, tns_auth_terminal: string, tns_auth_program_nm: string, tns_auth_machine: string]

scala> result2.count()
res7: Long = 21231

scala> result2.take(1)
res9: Array[org.apache.spark.sql.Row] = Array([58971,1.495641717739781E9,10.0.2.15,22,10.0.2.2,50302,null,null,null,null,null,null])

from hadoop-pcap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.