Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/mappings/abap.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 5
sidebar_position: 2
description: "ABAP Type System"
---

Expand Down
36 changes: 19 additions & 17 deletions docs/mappings/apache-spark.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,24 @@ description: "CSN Interop types to Apache Spark types."
> <span className="feature-status-draft">DRAFT</span> This mapping definition is work in progress and may be subject to further change.

- Spark Data Types coming from here: [Link](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/data_types.html)
- DataSphere Data Types coming from here: [Link](https://help.sap.com/docs/SAP_DATASPHERE/c8a54ee704e94e15926551293243fd1d/7b1dc6e0fad147de8e50aa8dc4744aa3.html?locale=en-US)

<!-- prettier-ignore -->
|CDS | Spark / Delta Lake | Datasphere | Comment | Spark format |
|--- |------------------- |----------- |-------- |--------------|
|`cds.Boolean`| BOOLEAN | `cds.Boolean`| | |
|`cds.String` (length ) | STRING | `cds.String` | Datasphere Logic: IF `cds.String(length = undefined)` THEN `cds.String(length = 5000)` | |
|`cds.LargeString` (length ) | STRING | `cds.LargeString` | | |
|`cds.Integer`| INT | `cds.Integer` | | |
|`cds.Integer64`| BIGINT | `cds.Integer64` | | |
|`cds.Decimal` (precision = p, scale = s)| DECIMAL(p,s) | `cds.Decimal` | Datasphere Logic: IF `cds.Decimal(p < 17)` THEN `cds.Decimal(p = 17)` | |
|`cds.Decimal` (precision = p, scale = floating) | ***not supported*** | `cds.Decimal` | Decimal with scale = floating is not supported in spark | |
|Amounts with Currencies `cds.Decimal` (precision = 34, scale = 4) | `cds.Decimal(34, 4)` | `cds.Decimal(34, 4)` | Since spark does not support `cds.DecimalFloat` we use cds.Decimal(34,4) as compromise for now | |
|`cds.Double`| DOUBLE | `cds.Double` | | |
|`cds.Date`| DATE | `cds.Date` | | "yyyyMMdd" |
|`cds.Time` must be expressed as `cds.String(6)` or `cds.String(12)` depending on the source representation for now + the annotation `@Semantics.time: true`| STRING | `cds.String(6)` or `cds.String(12)` | Data is in format `HHmmss` or `HH:mm:ss.SSS` - consumer must use the function to_time() to convert to `cds.Time`| |
|`cds.DateTime` sec precision| TIMESTAMP | `cds.Timestamp` | | |
|`cds.Timestamp` µs precision| TIMESTAMP | `cds.Timestamp` | | "yyyy-MM-dd'T'HH:mm:ss.SSSSSSS" |
|`cds.UUID` + the annotation `@Semantics.uuid: true`| STRING (36) | `cds.UUID` | | | |
|CDS | Spark / Delta Lake | Comment | Spark format |
|--- |------------------- |-------- |--------------|
|`cds.Boolean`| BOOLEAN| | |
|`cds.String` (length ) | STRING | | |
|`cds.LargeString` (length ) | STRING | | |
|`cds.Integer`| INT | | |
|`cds.Integer64`| BIGINT | | |
|`cds.Decimal` (precision = p, scale = s) | DECIMAL(p,s) | | |
|`cds.Decimal` (precision = p, scale = floating) | ***not supported*** | Decimal with scale = floating is not supported in spark | |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our proposal is to support this with cds.Decimal (precision = p, scale = floating) gets mapped to STRING in delta. Do you want to add this in the current PR or a later one?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HANA type SMALLDECIMAL seem to be not in the list. But I think, it may be fine to not include for now as there is no CDS type associated with it and so anyway CAP consumer/producer of DP can not consume/produce such type.

|Amounts with Currencies `cds.Decimal` (precision = 34, scale = 4) | `cds.Decimal(34, 4)` | Since spark does not support `cds.DecimalFloat` we use cds.Decimal(34,4) as compromise for now | |
|`cds.Decimal` (no arguments) | ***not supported*** | | |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for cds.Decimal (no arguments)

|`cds.Double` | DOUBLE | | |
|`cds.Date` | DATE | | "yyyyMMdd" |
|`cds.Time` must be expressed as `cds.String(6)` or `cds.String(12)` depending on the source representation for now + the annotation `@Semantics.time: true` | STRING | Data is in format `HHmmss` or `HH:mm:ss.SSS` - consumer must use the function to_time() to convert to `cds.Time`| |
|`cds.DateTime` sec precision | TIMESTAMP | | |
|`cds.Timestamp` µs precision | TIMESTAMP | | "yyyy-MM-dd'T'HH:mm:ss.SSSSSSS" |
|`cds.UUID` + the annotation `@Semantics.uuid: true` | STRING (36) | | |
|hana.ST_GEOMETRY (in DSP, not in CDS) | STRING | CSN with type info | |
|hana.ST_POINT | STRING | CSN with type info | |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new proposal to map cds.Vector to delta STRING.

30 changes: 30 additions & 0 deletions docs/mappings/datasphere.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
sidebar_position: 4
title: SAP Datasphere
description: "CSN Interop types to SAP Datasphere types."
---

> <span className="feature-status-draft">DRAFT</span> This mapping definition is work in progress and may be subject to further change.

- Datasphere Data Types coming from here: [Link](https://help.sap.com/docs/SAP_DATASPHERE/c8a54ee704e94e15926551293243fd1d/2f39104e5bd847919b8daee1580c4f68.html)

<!-- prettier-ignore -->
|CDS | Datasphere | Comment |
|--- |----------- |-------- |
|`cds.Boolean`| `cds.Boolean`| |
|`cds.String` (length ) | `cds.String` | Datasphere Logic: IF `cds.String(length = undefined)` THEN `cds.String(length = 5000)` |
|`cds.LargeString` (length ) | `cds.LargeString` | |
|`cds.Integer`| `cds.Integer` | |
|`cds.Integer64`| `cds.Integer64` | |
|`cds.Decimal` (precision = p, scale = s) | `cds.Decimal` | Datasphere Logic: IF `cds.Decimal(p < 17)` THEN `cds.Decimal(p = 17)` |
|`cds.Decimal` (precision = p, scale = floating) | `cds.Decimal` | |
|Amounts with Currencies `cds.Decimal` (precision = 34, scale = 4) | `cds.Decimal(34, 4)` | |
|`cds.Decimal` (no arguments) | DecimalFloat | |
|`cds.Double` | `cds.Double` | |
|`cds.Date` | `cds.Date` | |
|`cds.Time` must be expressed as `cds.String(6)` or `cds.String(12)` depending on the source representation for now + the annotation `@Semantics.time: true` | `cds.String(6)` or `cds.String(12)` | |
|`cds.DateTime` sec precision | `cds.Timestamp` | |
|`cds.Timestamp` µs precision | `cds.Timestamp` | |
|`cds.UUID` + the annotation `@Semantics.uuid: true` | `cds.UUID` | |
|- | hana.ST_GEOMETRY | |
|- | hana.ST_POINT | |
32 changes: 32 additions & 0 deletions docs/mappings/hana.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
sidebar_position: 3
title: SAP HANA
description: "CSN Interop types to SAP HANA types."
---

> <span className="feature-status-draft">DRAFT</span> This mapping definition is work in progress and may be subject to further change.

- HANA data types coming from here: [Link](https://help.sap.com/docs/SAP_HANA_PLATFORM/4fe29514fd584807ac9f2a04f6754767/20a1569875191014b507cf392724b7eb.html?locale=en-US) and in context with CAP / OData here: [Link](https://cap.cloud.sap/docs/advanced/hana#hana-types)

<!-- prettier-ignore -->
|CDS | HANA | Comment |
|--- |----- |-------- |
|`cds.Boolean`| BOOLEAN | |
|`cds.String` (length ) | NVARCHAR(length) | |
|`cds.LargeString` (length ) | NCLOB | |
|`cds.Integer`| INTEGER | |
|`cds.Integer64`| BIGINT | |
|`cds.Decimal` (precision = p, scale = s) | DECIMAL(p,s) | |
|`cds.Decimal` (precision = p, scale = floating) | DECIMAL | |
|Amounts with Currencies `cds.Decimal` (precision = 34, scale = 4) | DECIMAL(34,4) | |
|`cds.Decimal` (no arguments) | DECIMAL | |
|`cds.Double` | DOUBLE | |
|`cds.Date` | DATE | |
|`cds.Time` must be expressed as `cds.String(6)` or `cds.String(12)` depending on the source representation for now + the annotation `@Semantics.time: true` | TIME | Data is in format `HHmmss` or `HH:mm:ss.SSS` - consumer must use the function to_time() to convert to `cds.Time`|
|`cds.DateTime` sec precision | TIMESTAMP | |
|`cds.Timestamp` µs precision | TIMESTAMP | HANA with ns precision (precision loss) |
|`cds.UUID` + the annotation `@Semantics.uuid: true` | NVARCHAR(36) | |
|- | ST_GEOMETRY | |
|- | ST_POINT | |
|`cds.vector` | REAL_VECTOR | |
|- | HALF_VECTOR | HANA half-precision vector type |
Empty file modified docs/mappings/index.mdx
100644 → 100755
Empty file.