-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix outputType struct tag for VirtualColumn expressions (#51)
* exclude examples from build * fix outputType on expressions Co-authored-by: Shrivardhan Rao <[email protected]>
- Loading branch information
1 parent
e4e47db
commit f9a9537
Showing
5 changed files
with
30 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package virtualcolumn | ||
|
||
import ( | ||
"encoding/json" | ||
"github.com/grafadruid/go-druid/builder/types" | ||
"github.com/stretchr/testify/assert" | ||
"testing" | ||
) | ||
|
||
func TestNewExpression(t *testing.T) { | ||
expression := NewExpression() | ||
expression.SetName("dim1").SetExpression("lower(\"dim1\")").SetOutputType(types.String) | ||
|
||
expected := `{"type":"expression", "name":"dim1", "expression": "lower(\"dim1\")", "outputType":"STRING"}` | ||
|
||
expressionJSON, err := json.Marshal(expression) | ||
assert.Nil(t, err) | ||
assert.JSONEq(t, expected, string(expressionJSON)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//+build mage | ||
|
||
package main | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//+build mage | ||
|
||
package main | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//+build mage | ||
|
||
package main | ||
|
||
import ( | ||
|