-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RD-9261 implement csv infer and read (#43)
- Implemented Csv.InferAndRead - Added encoding to Json.InferAndRead
- Loading branch information
1 parent
b78f20c
commit 5d79a82
Showing
5 changed files
with
312 additions
and
28 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
38 changes: 38 additions & 0 deletions
38
...compiler-rql2/src/main/scala/raw/compiler/rql2/builtin/InMemoryLocationValueBuilder.scala
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,38 @@ | ||
/* | ||
* Copyright 2023 RAW Labs S.A. | ||
* | ||
* Use of this software is governed by the Business Source License | ||
* included in the file licenses/BSL.txt. | ||
* | ||
* As of the Change Date specified in that file, in accordance with | ||
* the Business Source License, use of this software will be governed | ||
* by the Apache License, Version 2.0, included in the file | ||
* licenses/APL.txt. | ||
*/ | ||
|
||
package raw.compiler.rql2.builtin | ||
|
||
import raw.compiler.rql2.{Arg, ValueArg} | ||
import raw.sources.bytestream.in_memory.InMemoryByteStreamLocation | ||
import raw.sources.{LocationSettingKey, LocationSettingValue} | ||
import raw.runtime.interpreter.{LocationValue, StringValue} | ||
import raw.sources.{LocationBinarySetting, LocationDescription} | ||
import raw.compiler.rql2.source.Rql2LocationType | ||
|
||
object InMemoryLocationValueBuilder { | ||
def build(mandatoryArgs: Seq[Arg]): (ValueArg, String) = { | ||
val codeData = mandatoryArgs.head match { | ||
case ValueArg(v, _) => v match { | ||
case StringValue(innVal) => innVal | ||
} | ||
} | ||
val settings = Map[LocationSettingKey, LocationSettingValue]( | ||
( | ||
LocationSettingKey(InMemoryByteStreamLocation.codeDataKey), | ||
LocationBinarySetting(codeData.getBytes()) | ||
) | ||
) | ||
val locationDescription = LocationDescription(InMemoryByteStreamLocation.schemaWithColon, settings) | ||
(ValueArg(LocationValue(locationDescription), Rql2LocationType()), codeData) | ||
} | ||
} |
Oops, something went wrong.