메뉴 건너뛰기

Cloudera, BigData, Semantic IoT, Hadoop, NoSQL

Cloudera CDH/CDP 및 Hadoop EcoSystem, Semantic IoT등의 개발/운영 기술을 정리합니다. gooper@gooper.com로 문의 주세요.


import org.apache.spark.sql.SparkSession

object AccountsByState {
  def main(args: Array[String]) {
    if (args.length < 1) {
      System.err.println("Usage: stubs.AccountByState <state-code>")
      System.exit(1)
    }

    val stateCode = args(0)
    val spark = SparkSession.builder.getOrCreate()

    val accountsDF = spark.read.table("accounts")
    val stateAccountsDF = accountsDF.where(accountsDF("state") === stateCode)
    stateAccountsDF.write.mode("overwrite").save("/loudacre/accounts_by_state/"+stateCode)

    spark.stop

  }
}

번호 제목 날짜 조회 수
561 [TLS/SSL]Kudu Tablet Server설정 2022.05.13 278
560 [impala]쿼리 수행중 발생하는 오류(due to memory pressure: the memory usage of this transaction, Failed to write to server) 2022.10.05 279
559 lagom의 online-auction-java프로젝트 실행시 "Could not find Cassandra contact points, due to: ServiceLocator is not bound" 경고 발생시 조치사항 2017.10.12 281
558 spark2.0.0에서 hive 2.0.1 table을 읽어 출력하는 예제 소스(HiveContext, SparkSession, SQLContext) 2017.03.09 284
557 하둡기반 데이타 모델링(6편) 2018.06.27 289
556 anaconda3(v5.4)를 이용하여 tensorflow설치후 ipython프로그램을 실행하여 import할때 오류발생시 조치 2018.07.27 289
555 Cloudera설치중에 "Error, CM server guid updated"오류 발생시 조치방법 2018.03.29 290
554 [CDP7.1.7]Hive Replication수행중 Specified catalog.database.table does not exist : hive.db명.table명 오류 발생시 조치방법 2024.04.05 290
553 windows7에서 lagom의 hello world를 빌드하여 실행하는 경우의 로그(mvn lagom:runAll -Dscala.binary.version=2.11) 2017.12.22 291
552 javax.net.ssl.SSLHanshakeException: SSLHandshakeException invoking https://mainCluster.gooper.com:7183/api/v1/users: sun.security.validator.ValidatorException: No trusted certificate found 2022.06.29 291
551 Spark Streaming 코드레벨단에서의 성능개선 2016.10.31 293
550 cloudera의 hue에서 사용자가 사용한 쿼리 목록 2020.02.07 296
549 Cloudera Manager의 Java Heap Size변경하는 방법 2022.06.27 298
548 [Impala TLS/SSL이슈]RangerAdminRESTClient.java:151] Failed to get response, Error is: TrustManager is not specified 2023.02.02 298
547 CDH 5.4.4 버전에서 hive on tez (0.7.0)설치하기 2016.01.14 299
546 java quartz 시간 설정 참고사항 2015.12.16 300
545 spark-sql실행시 ERROR log: Got exception: java.lang.NumberFormatException For input string: "2000ms" 오류발생시 조치사항 2016.06.09 301
544 scala-eclipse 다운로드 2019.06.09 301
» scala application 샘플소스(SparkSession이용) 2018.03.07 304
542 바나나 파이의 /tmp폴더를 외장하드로 변경하기 2015.07.24 307
위로