0
SQL Server 데이터베이스에서 데이터를 가져 와서 스파크 데이터 세트를 만들려고합니다. 내가 orientdb에 대한 데이터 집합을 유지할 때, 그렇게 할 수 없다.orientdb에 설정된 Spark 데이터를 유지할 수 없습니다.
오류 아래 스레드에서
예외 얻기 "주"java.lang.RuntimeException가이 : 연결 예외가 발생했습니다 : 오류를 데이터베이스 열기에 'JDBC를 : 동양 : REMOTE를 : 로컬 호스트/테스트'
여기내 코드입니다 :
Map<String, String> options = new HashMap<>();
options.put("driver", "com.microsoft.sqlserver.jdbc.SQLServerDriver");
options.put("url", "jdbc:sqlserver://localhost:1433;databaseName=sample");
options.put("user", "username");
options.put("password", "password");
DataFrameReader jdbcDF = spark.read().format("jdbc").options(options);
Dataset<Row> tableDataSet = jdbcDF.option("dbtable", "Table1").load();
tableDataSet.createOrReplaceTempView("TEMP_V");
Dataset<Row> tableDataset1 = spark.sql("SELECT ID AS DEPT_ID, NAME AS DEPT_NAME FROM TEMP_V");
tableDataset1.write().format("org.apache.spark.orientdb.graphs")
.option("dburl", "jdbc:orient:remote:localhost/test")
.option("user", "root")
.option("password", "root")
.option("spark", "true")
.option("vertextype", "DEPARTMENT")
.mode(SaveMode.Overwrite)
.save();
오류 메시지에 testdb가 있지만 코드에 url 테스트가 있습니다. 여기에 혼란이 있습니까? – BDR
발자국 없음. 거기에 타이핑 된 미스 (testdb). 나는 어떤 orientdb 데이터베이스에도 데이터 셋을 쓸 수 없다. –