Skip to content

Commit

Permalink
修复测试报错 (#1881)
Browse files Browse the repository at this point in the history
添加hive保存错误日志

添加hive保存错误日志

revert the MLSQLJDBC.scala change
  • Loading branch information
hellozepp authored Jan 30, 2023
1 parent 892d64a commit e373adf
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ object HDFSOperatorV2 {
file
}

def getContentSummary(path: String): ContentSummary = {
val fs = new Path(path).getFileSystem(hadoopConfiguration)
fs.getContentSummary(new Path(path))
}

def readAsInputStream(fileName: String): InputStream = {
val src: Path = new Path(fileName)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Date,2022/9/21,_c2
name,age,demo
jack,111,12312
jack2,123,12312
Expand All @@ -7,4 +8,8 @@ jack,159,12312
jack4,171,12312
jack,183,12312
jack5,195,12312
jack,207,12312
jack,207,12312

Info,demo about skip n lines,null
Case,IT,null
Result,Success,null
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load parquet.`/ssb/customer/part-00000-7505a64d-b4bf-4186-874a-a9898502a51e-c000.snappy.parquet` as customer_parquet;
select * from customer_parquet as customer;

run customer as DataSummary.`` as customer_sumary;
run customer as DataSummary.`` where metrics="dataType,dataLength,max,min,maximumLength,minimumLength,mean,standardDeviation,standardError,nullValueRatio,blankValueRatio,nonNullCount,uniqueValueRatio,primaryKeyCandidate,median,mode,categoryCount,skewness" as customer_sumary;
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
columnName,ordinalPosition,median,blankValueRatio,dataLength,dataType,max,maximumLength,mean,min,minimumLength,nonNullCount,nullValueRatio,standardDeviation,standardError,uniqueValueRatio,primaryKeyCandidate,mode
C_CUSTKEY,1,150.5,0.0,4,integer,300.0,,150.5,1.0,,300,0.0,86.75,5.01,1.0,1,
C_NAME,2,,0.0,18,string,Customer#000000300,18,,Customer#000000001,18,300,0.0,,,1.0,1,
C_ADDRESS,3,,0.0,24,string,zwrDoaY2gxCk,24,, 6I1TTaoG7bbiogC,6,300,0.0,,,1.0,1,
C_CITY,4,,0.0,10,string,VIETNAM 9,10,,ALGERIA 1,10,300,0.0,,,0.56,0,JAPAN 2
C_NATION,5,,0.0,14,string,VIETNAM,14,,ALGERIA,4,300,0.0,,,0.0833,0,
C_REGION,6,,0.0,11,string,MIDDLE EAST,11,,AFRICA,4,300,0.0,,,0.0167,0,ASIA
C_PHONE,7,,0.0,15,string,34-700-976-1809,15,,10-172-710-1650,15,300,0.0,,,1.0,1,
C_MKTSEGMENT,8,,0.0,10,string,MACHINERY,10,,AUTOMOBILE,8,300,0.0,,,0.0167,0,AUTOMOBILE
columnName,ordinalPosition,median,blankValueRatio,dataLength,dataType,max,maximumLength,mean,min,minimumLength,nonNullCount,nullValueRatio,skewness,standardDeviation,standardError,uniqueValueRatio,categoryCount,primaryKeyCandidate,mode
C_CUSTKEY,1,150.5,0.0,4,integer,300.0,,150.5,1.0,,300,0.0,0.0,86.75,5.01,1.0,,1,
C_NAME,2,,0.0,18,string,Customer#000000300,18,,Customer#000000001,18,300,0.0,,,,1.0,300,1,
C_ADDRESS,3,,0.0,24,string,zwrDoaY2gxCk,24,, 6I1TTaoG7bbiogC,6,300,0.0,,,,1.0,300,1,
C_CITY,4,,0.0,10,string,VIETNAM 9,10,,ALGERIA 1,10,300,0.0,,,,0.56,168,0,JAPAN 2
C_NATION,5,,0.0,14,string,VIETNAM,14,,ALGERIA,4,300,0.0,,,,0.0833,25,0,
C_REGION,6,,0.0,11,string,MIDDLE EAST,11,,AFRICA,4,300,0.0,,,,0.0167,5,0,ASIA
C_PHONE,7,,0.0,15,string,34-700-976-1809,15,,10-172-710-1650,15,300,0.0,,,,1.0,300,1,
C_MKTSEGMENT,8,,0.0,10,string,MACHINERY,10,,AUTOMOBILE,8,300,0.0,,,,0.0167,5,0,AUTOMOBILE
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class ByzerScriptTestSuite extends LocalBaseTestSuite with Logging {
}

} else {
logInfo(s"Can not support current version:$version, skip it.")
logInfo(s"Can not support current version:$version, skip it.")
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ class RestComparator extends Comparator {
val actualRow = resultSeq(i)
val expectedRow = expected(i)
if (actualRow.length != expectedRow.length) {
return (false, msg)
// Compare empty lines separately
if (!(actualRow.isEmpty && expectedRow.length == 1 && expectedRow.head.isEmpty)) {
return (false, msg)
}
}
for (j <- actualRow.indices) {
val actualVal = actualRow(j)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ object ByzerCluster extends Logging {
def forSpec(dataDirPath: String): ByzerCluster = {
beforeAll()
lazy val hadoopContainer: HadoopContainer = new HadoopContainer(clusterName).configure { c =>
c.addExposedPorts(9870, 8088, 19888, 10002, 8042, 8020, 9866)
c.addExposedPorts(9870, 8088, 19888, 10002, 8042, 8020, 9866, 9001)
c.withNetwork(network)
c.withNetworkAliases(ByzerCluster.appendClusterName(networkAliases))
c.setWaitStrategy(new HttpWaitStrategy()
Expand Down

0 comments on commit e373adf

Please sign in to comment.