GithubHelp home page GithubHelp logo

Comments (4)

zouzias avatar zouzias commented on June 2, 2024

Hey,

Which example does not work? Is it one of the shape examples on https://github.com/zouzias/spark-lucenerdd-examples?

from spark-lucenerdd.

slyons avatar slyons commented on June 2, 2024

Any time I try to follow the Geo or connective examples the imports do not
work

On Sep 15, 2016 00:38, "Anastasios Zouzias" [email protected]
wrote:

Hey,

Which example does not work? Is it one of the shape examples on
https://github.com/zouzias/spark-lucenerdd-examples?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#50 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAChu1Y2-sXEb-qspEmNwaJ4KWQGJMkCks5qqPYLgaJpZM4J9K63
.

from spark-lucenerdd.

zouzias avatar zouzias commented on June 2, 2024

Hey, you are right. The examples on the wiki were outdated. Now they are fixed.

scala> :paste
// Entering paste mode (ctrl-D to finish)

import org.zouzias.spark.lucenerdd.spatial.shape.ShapeLuceneRDD
import org.zouzias.spark.lucenerdd.spatial.shape._
import org.zouzias.spark.lucenerdd._
import org.zouzias.spark.lucenerdd.LuceneRDD

val df = sqlContext.read.format("com.databricks.spark.csv").option("header", "false").option("inferSchema", "true").option("delimiter", "\t").load("src/test/resources/spatial/CH.txt")
val swissCities = df.select("C0", "C1", "C5", "C4").map(row => ((row.getDouble(2), row.getDouble(3)), row.getString(1).toLowerCase()))
val shapes = ShapeLuceneRDD(swissCities)
shapes.count

// Exiting paste mode, now interpreting.

import org.zouzias.spark.lucenerdd.spatial.shape.ShapeLuceneRDD                 
import org.zouzias.spark.lucenerdd.spatial.shape._
import org.zouzias.spark.lucenerdd._
import org.zouzias.spark.lucenerdd.LuceneRDD
df: org.apache.spark.sql.DataFrame = [C0: int, C1: string, C2: string, C3: string, C4: double, C5: double, C6: string, C7: string, C8: string, C9: string, C10: string, C11: int, C12: int, C13: string, C14: int, C15: int, C16: int, C17: string, C18: string]
swissCities: org.apache.spark.rdd.RDD[((Double, Double), String)] = MapPartitionsRDD[12] at map at <console>:31
shapes: org.zouzias.spark.lucenerdd.spatial.shape.ShapeLuceneRDD[(Double, Double),String] = ShapeLuceneRDD[14] at RDD at ShapeLuceneRDD.scala:43
res0: Long = 49956

scala> 

from spark-lucenerdd.

zouzias avatar zouzias commented on June 2, 2024

Many thanks for reporting the issues!

from spark-lucenerdd.

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.