Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gatorsmile committed Jan 23, 2018
1 parent 87ffe7a commit 4f4032d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1708,6 +1708,8 @@ case class BitLength(child: Expression) extends UnaryExpression with ImplicitCas
case BinaryType => defineCodeGen(ctx, ev, c => s"($c).length * 8")
}
}

override def prettyName: String = "bit_length"
}

/**
Expand Down Expand Up @@ -1735,6 +1737,8 @@ case class OctetLength(child: Expression) extends UnaryExpression with ImplicitC
case BinaryType => defineCodeGen(ctx, ev, c => s"($c).length")
}
}

override def prettyName: String = "octet_length"
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ struct<(7 % 2):int,(7 % 0):int,(0 % 2):int,(7 % CAST(NULL AS INT)):int,(CAST(NUL
-- !query 51
select BIT_LENGTH('abc')
-- !query 51 schema
struct<bitlength(abc):int>
struct<bit_length(abc):int>
-- !query 51 output
24

Expand All @@ -449,7 +449,7 @@ struct<length(abc):int>
-- !query 54
select OCTET_LENGTH('abc')
-- !query 54 schema
struct<octetlength(abc):int>
struct<octet_length(abc):int>
-- !query 54 output
3

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- Automatically generated by SQLQueryTestSuite
-- Number of queries: 29
-- Number of queries: 27


-- !query 0
Expand Down Expand Up @@ -307,21 +307,22 @@ struct<t1a:string>
val1c
val1d

-- !query 22

-- !query 20
SELECT count(t1a)
FROM t1 RIGHT JOIN t2
ON t1d = t2d
WHERE t1a < (SELECT max(t2a)
FROM t2
WHERE t2c = t1c
GROUP BY t2c)
-- !query 22 schema
-- !query 20 schema
struct<count(t1a):bigint>
-- !query 22 output
-- !query 20 output
7


-- !query 23
-- !query 21
SELECT t1a
FROM t1
WHERE t1b <= (SELECT max(t2b)
Expand All @@ -332,14 +333,14 @@ AND t1b >= (SELECT min(t2b)
FROM t2
WHERE t2c = t1c
GROUP BY t2c)
-- !query 23 schema
-- !query 21 schema
struct<t1a:string>
-- !query 23 output
-- !query 21 output
val1b
val1c


-- !query 24
-- !query 22
SELECT t1a
FROM t1
WHERE t1a <= (SELECT max(t2a)
Expand All @@ -353,14 +354,14 @@ WHERE t1a >= (SELECT min(t2a)
FROM t2
WHERE t2c = t1c
GROUP BY t2c)
-- !query 24 schema
-- !query 22 schema
struct<t1a:string>
-- !query 24 output
-- !query 22 output
val1b
val1c


-- !query 25
-- !query 23
SELECT t1a
FROM t1
WHERE t1a <= (SELECT max(t2a)
Expand All @@ -374,9 +375,9 @@ WHERE t1a >= (SELECT min(t2a)
FROM t2
WHERE t2c = t1c
GROUP BY t2c)
-- !query 25 schema
-- !query 23 schema
struct<t1a:string>
-- !query 25 output
-- !query 23 output
val1a
val1a
val1b
Expand All @@ -387,7 +388,7 @@ val1d
val1d


-- !query 26
-- !query 24
SELECT t1a
FROM t1
WHERE t1a <= (SELECT max(t2a)
Expand All @@ -401,16 +402,16 @@ WHERE t1a >= (SELECT min(t2a)
FROM t2
WHERE t2c = t1c
GROUP BY t2c)
-- !query 26 schema
-- !query 24 schema
struct<t1a:string>
-- !query 26 output
-- !query 24 output
val1a
val1b
val1c
val1d


-- !query 27
-- !query 25
SELECT t1a
FROM t1
WHERE t1a <= (SELECT max(t2a)
Expand All @@ -424,22 +425,22 @@ WHERE t1a >= (SELECT min(t2a)
FROM t2
WHERE t2c = t1c
GROUP BY t2c)
-- !query 27 schema
-- !query 25 schema
struct<t1a:string>
-- !query 27 output
-- !query 25 output
val1a


-- !query 28
-- !query 26
SELECT t1a
FROM t1
GROUP BY t1a, t1c
HAVING max(t1b) <= (SELECT max(t2b)
FROM t2
WHERE t2c = t1c
GROUP BY t2c)
-- !query 28 schema
-- !query 26 schema
struct<t1a:string>
-- !query 28 output
-- !query 26 output
val1b
val1c

0 comments on commit 4f4032d

Please sign in to comment.