Skip to content
Merged
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
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,19 @@ Join our growing community of developers and data engineers on [RosettaDB Slack]

The table below lists the currently supported databases and their respective translation capabilities.

| | **BigQuery** | **Snowflake** | **MySQL** | **Postgres** | **Kinetica** | **Google Cloud Spanner** | **SQL Server** | **DB2** | **Oracle** | **Redshift** |
|--------------------------|:--------------:|:-------------:|:------------:|:---------------:|:------------:|:------------------------:|:---------------:|:-----------:|:--------------:|:------------:|
| **BigQuery** | / | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **Snowflake** | ✅ | / | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **MySQL** | ✅ | ✅ | / | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **Postgres** | ✅ | ✅ | ✅ | / | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **Kinetica** | ✅ | ✅ | ✅ | ✅ | / | ✅ | ✅ | ✅ | ✅ | ✅ |
| **Google Cloud Spanner** | ✅ | ✅ | ✅ | ✅ | ✅ | / | ✅ | ✅ | ✅ | ✅ |
| **SQL Server** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | / | ✅ | ✅ | ✅ |
| **DB2** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | / | ✅ | ✅ |
| **Oracle** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | / | ✅ |
| **Redshift** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | / |
| | **BigQuery** | **Snowflake** | **MySQL** | **Postgres** | **Kinetica** | **Google Cloud Spanner** | **SQL Server** | **DB2** | **Oracle** | **Redshift** | **SAP IQ(Sybase)** |
|--------------------------|:--------------:|:-------------:|:------------:|:---------------:|:------------:|:------------------------:|:---------------:|:-----------:|:--------------:|:------------:|:------------------:|
| **BigQuery** | / | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| **Snowflake** | ✅ | / | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| **MySQL** | ✅ | ✅ | / | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| **Postgres** | ✅ | ✅ | ✅ | / | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| **Kinetica** | ✅ | ✅ | ✅ | ✅ | / | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| **Google Cloud Spanner** | ✅ | ✅ | ✅ | ✅ | ✅ | / | ✅ | ✅ | ✅ | ✅ | ❌ |
| **SQL Server** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | / | ✅ | ✅ | ✅ | ❌ |
| **DB2** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | / | ✅ | ✅ | ❌ |
| **Oracle** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | / | ✅ | ❌ |
| **Redshift** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | / | ❌ |
| **SAP IQ(Sybase)** | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | / |


## Getting Started
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Copyright 2022 AdaptiveScale
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.adataptivescale.rosetta.source.core.extractors.column;

import com.adaptivescale.rosetta.common.TranslationMatrix;
import com.adaptivescale.rosetta.common.annotations.RosettaModule;
import com.adaptivescale.rosetta.common.models.Column;
import com.adaptivescale.rosetta.common.models.input.Connection;
import com.adaptivescale.rosetta.common.types.RosettaModuleTypes;

import java.sql.ResultSet;
import java.sql.SQLException;


@RosettaModule(
name = "sapiq",
type = RosettaModuleTypes.COLUMN_EXTRACTOR
)
public class SAPIQColumnsExtractor extends ColumnsExtractor{
public SAPIQColumnsExtractor(Connection connection) {
super(connection);
}

@Override
protected void extract(ResultSet resultSet, Column column) throws SQLException {
column.setName(resultSet.getString("COLUMN_NAME"));

String columnType = resultSet.getString("TYPE_NAME");
if (columnType != null) {
column.setTypeName(TranslationMatrix.getInstance().findBySourceTypeAndSourceColumnType("sapiq", columnType));
}

String nullableStr = resultSet.getString("IS_NULLABLE");
if (nullableStr != null && (nullableStr.equalsIgnoreCase("YES") || nullableStr.equalsIgnoreCase("NO"))) {
column.setNullable("YES".equalsIgnoreCase(nullableStr));
} else {
column.setNullable(resultSet.getBoolean("IS_NULLABLE"));
}

column.setColumnDisplaySize(resultSet.getInt("COLUMN_SIZE"));
column.setScale(resultSet.getInt("DECIMAL_DIGITS"));
column.setPrecision(resultSet.getInt("COLUMN_SIZE"));
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright 2022 AdaptiveScale
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.adataptivescale.rosetta.source.core.extractors.table;

import com.adaptivescale.rosetta.common.annotations.RosettaModule;
import com.adaptivescale.rosetta.common.types.RosettaModuleTypes;

@RosettaModule(
name = "sapiq",
type = RosettaModuleTypes.TABLE_EXTRACTOR
)
public class SAPIQTablesExtractor extends DefaultTablesExtractor{

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright 2022 AdaptiveScale
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.adataptivescale.rosetta.source.core.extractors.view;

import com.adaptivescale.rosetta.common.annotations.RosettaModule;
import com.adaptivescale.rosetta.common.types.RosettaModuleTypes;

@RosettaModule(
name = "sapiq",
type = RosettaModuleTypes.VIEW_EXTRACTOR
)
public class SAPIQViewExtractor extends DefaultViewExtractor{

}

25 changes: 25 additions & 0 deletions translator/src/main/resources/translation_matrix/translation.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2697,3 +2697,28 @@
2883;;redshift;;varbyte;;spanner;;bytes
2884;;redshift;;intervaly2m;;spanner;;string
2885;;redshift;;intervald2s;;spanner;;string
2886;;sapiq;;varchar;;kinetica;;string
2887;;sapiq;;char;;kinetica;;string
2888;;sapiq;;long varchar;;kinetica;;string
2889;;sapiq;;int;;kinetica;;int
2890;;sapiq;;integer;;kinetica;;int
2891;;sapiq;;smallint;;kinetica;;int16
2892;;sapiq;;bigint;;kinetica;;long
2893;;sapiq;;unsigned bigint;;kinetica;;ulong
2894;;sapiq;;unsigned int;;kinetica;;int
2895;;sapiq;;timestamp;;kinetica;;timestamp
2896;;sapiq;;date;;kinetica;;date
2897;;sapiq;;binary;;kinetica;;bytes
2898;;sapiq;;time;;kinetica;;time
2899;;sapiq;;tinyint;;kinetica;;int8
2900;;sapiq;;bit;;kinetica;;int8
2901;;sapiq;;decimal;;kinetica;;decimal
2902;;sapiq;;numeric;;kinetica;;decimal
2903;;sapiq;;double;;kinetica;;double
2904;;sapiq;;double precision;;kinetica;;double
2905;;sapiq;;real;;kinetica;;float
2906;;sapiq;;float;;kinetica;;float
2907;;sapiq;;varbinary;;kinetica;;bytes
2908;;sapiq;;long binary;;kinetica;;bytes
2909;;sapiq;;blob;;kinetica;;bytes
2910;;sapiq;;clob;;kinetica;;string
Loading