Coder Social home page Coder Social logo

agens-spark-modules's People

Contributors

maxmin93 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

agens-spark-modules's Issues

spark-cypher 모듈에서 Float 타입을 Double 로 처리해 unionAll 에서 Mismatch 오류 발생

  • Problem

ES 에 저장된 property.type = java.lang.Float 인 데이터 property.value 를 spark-cypher 에서 읽어들이면서 Double 로 변환
이후, cypher 처리 과정에서 변환 값을 StructType(Float) 에 저장할 때 type mismatch 오류 발생

Expected:
	Equal column data types for union all (differing nullability is OK)
Found:
	Left fields:  ... StructField(node_e_score __ FLOAT?,DoubleType,true) ...

SparkTable.scala:186

// ERROR: mismatch (float type => double type)
leftTypes.zip(rightTypes).foreach {
  case (leftType, rightType) if !leftType.nullable.couldBeSameTypeAs(rightType.nullable) =>
    throw IllegalArgumentException(
      "Equal column data types for union all (differing nullability is OK)",
      s"Left fields:  ${df.schema.fields.mkString(", ")}\n\tRight fields: ${other.df.schema.fields.mkString(", ")}")
  case _ =>
}
  • comment

spark-cypher 코드 자체에서는 Float 를 Double 로 타입변환 시키는 코드는 없음
내부에 사용한 다른 라이브러리에서 처리된 영향인듯 하나, 현재로서는 찾지 못하고 있음

  • Solution (not perpect)

값을 입력할 때, "java.lang.Float" 는 사용하지 말도록 권고 (must be "java.lang.Double")

  • addition

그 외 "java.lang.Integer" 등은 관계 없음. 단지, 소수점 숫자값에 대해서만 문제 발견

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.