From 879e5d2301be92876523970fc6f826babd18cea9 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Thu, 29 Aug 2024 06:25:06 -0400 Subject: [PATCH 01/57] testing CI after branching issues --- .../snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java index 1af2b87..707cffe 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java @@ -58,7 +58,7 @@ public class SnowflakeVirtualSchemaIntegrationTestSetup implements Closeable { SnowflakeVirtualSchemaIntegrationTestSetup() { try { this.exasolContainer.start(); - // TODO add localstack support + cleanup + // TODO add localstack support // this.snowflakeContainer.start(); final Bucket bucket = this.exasolContainer.getDefaultBucket(); uploadDriverToBucket(this.exasolContainer); From fd06366184703733693ef143fd81112f3bc70b56 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Thu, 29 Aug 2024 06:37:14 -0400 Subject: [PATCH 02/57] adding required files for PK --- .settings/org.eclipse.jdt.core.prefs | 502 +++++++++++++++++++++++++++ .settings/org.eclipse.jdt.ui.prefs | 205 +++++++++++ .vscode/settings.json | 23 ++ 3 files changed, 730 insertions(+) create mode 100644 .settings/org.eclipse.jdt.core.prefs create mode 100644 .settings/org.eclipse.jdt.ui.prefs create mode 100644 .vscode/settings.json diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..bb40c3f --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,502 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullable.secondary= +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.APILeak=warning +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=ignore +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled +org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.processAnnotations=disabled +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=11 +org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false +org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false +org.eclipse.jdt.core.formatter.align_with_spaces=false +org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_enum_constant=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter=0 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type=49 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assertion_message=0 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_record_components=16 +org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_shift_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_type_annotations=0 +org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch=0 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_record_constructor=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_record_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true +org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false +org.eclipse.jdt.core.formatter.comment.indent_root_tags=false +org.eclipse.jdt.core.formatter.comment.indent_tag_description=false +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=120 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false +org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=space +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.text_block_indentation=0 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true +org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true +org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator=true +org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true +org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true +org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true +org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/.settings/org.eclipse.jdt.ui.prefs b/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000..1add06a --- /dev/null +++ b/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,205 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=true +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=true +cleanup.convert_to_enhanced_for_loop=true +cleanup.correct_indentation=true +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=true +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=true +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_modifiers=false +cleanup.remove_redundant_semicolons=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=true +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=true +cleanup.use_this_for_non_static_field_access=true +cleanup.use_this_for_non_static_field_access_only_if_necessary=false +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_Exasol +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_Exasol +formatter_settings_version=21 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.ondemandthreshold=3 +org.eclipse.jdt.ui.staticondemandthreshold=3 +sp_cleanup.add_all=false +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=true +sp_cleanup.always_use_this_for_non_static_field_access=true +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.array_with_curly=false +sp_cleanup.arrays_fill=false +sp_cleanup.bitwise_conditional_expression=false +sp_cleanup.boolean_literal=false +sp_cleanup.boolean_value_rather_than_comparison=false +sp_cleanup.break_loop=false +sp_cleanup.collection_cloning=false +sp_cleanup.comparing_on_criteria=false +sp_cleanup.comparison_statement=false +sp_cleanup.controlflow_merge=false +sp_cleanup.convert_functional_interfaces=true +sp_cleanup.convert_to_enhanced_for_loop=true +sp_cleanup.convert_to_enhanced_for_loop_if_loop_var_used=false +sp_cleanup.convert_to_switch_expressions=false +sp_cleanup.correct_indentation=true +sp_cleanup.do_while_rather_than_while=false +sp_cleanup.double_negation=false +sp_cleanup.else_if=false +sp_cleanup.embedded_if=false +sp_cleanup.evaluate_nullable=false +sp_cleanup.extract_increment=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.hash=false +sp_cleanup.if_condition=false +sp_cleanup.insert_inferred_type_arguments=false +sp_cleanup.instanceof=false +sp_cleanup.instanceof_keyword=false +sp_cleanup.invert_equals=false +sp_cleanup.join=false +sp_cleanup.lazy_logical_operator=false +sp_cleanup.make_local_variable_final=true +sp_cleanup.make_parameters_final=true +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=true +sp_cleanup.map_cloning=false +sp_cleanup.merge_conditional_blocks=false +sp_cleanup.multi_catch=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=false +sp_cleanup.no_string_creation=false +sp_cleanup.no_super=false +sp_cleanup.number_suffix=false +sp_cleanup.objects_equals=false +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.one_if_rather_than_duplicate_blocks_that_fall_through=false +sp_cleanup.operand_factorization=false +sp_cleanup.organize_imports=true +sp_cleanup.overridden_assignment=false +sp_cleanup.plain_replacement=false +sp_cleanup.precompile_regex=false +sp_cleanup.primitive_comparison=false +sp_cleanup.primitive_parsing=false +sp_cleanup.primitive_rather_than_wrapper=false +sp_cleanup.primitive_serialization=false +sp_cleanup.pull_out_if_from_if_else=false +sp_cleanup.pull_up_assignment=false +sp_cleanup.push_down_negation=false +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=true +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.reduce_indentation=false +sp_cleanup.redundant_comparator=false +sp_cleanup.redundant_falling_through_block_end=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_redundant_modifiers=false +sp_cleanup.remove_redundant_semicolons=true +sp_cleanup.remove_redundant_type_arguments=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_array_creation=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=true +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.return_expression=false +sp_cleanup.simplify_lambda_expression_and_method_ref=false +sp_cleanup.single_used_field=false +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.standard_comparison=false +sp_cleanup.static_inner_class=false +sp_cleanup.strictly_equal_or_different=false +sp_cleanup.stringbuffer_to_stringbuilder=false +sp_cleanup.stringbuilder=false +sp_cleanup.stringbuilder_for_local_vars=false +sp_cleanup.substring=false +sp_cleanup.switch=false +sp_cleanup.system_property=false +sp_cleanup.system_property_boolean=false +sp_cleanup.system_property_file_encoding=false +sp_cleanup.system_property_file_separator=false +sp_cleanup.system_property_line_separator=false +sp_cleanup.system_property_path_separator=false +sp_cleanup.ternary_operator=false +sp_cleanup.try_with_resource=false +sp_cleanup.unlooped_while=false +sp_cleanup.unreachable_block=false +sp_cleanup.use_anonymous_class_creation=false +sp_cleanup.use_autoboxing=false +sp_cleanup.use_blocks=true +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_directly_map_method=false +sp_cleanup.use_lambda=true +sp_cleanup.use_parentheses_in_expressions=true +sp_cleanup.use_string_is_blank=false +sp_cleanup.use_this_for_non_static_field_access=true +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=false +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true +sp_cleanup.use_unboxing=false +sp_cleanup.use_var=false +sp_cleanup.useless_continue=false +sp_cleanup.useless_return=false +sp_cleanup.valueof_rather_than_instantiation=false diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..a7ae59b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,23 @@ +{ + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports": "explicit", + "source.generate.finalModifiers": "explicit", + "source.fixAll": "explicit" + }, + "java.codeGeneration.useBlocks": true, + "java.saveActions.organizeImports": true, + "java.sources.organizeImports.starThreshold": 3, + "java.sources.organizeImports.staticStarThreshold": 3, + "java.test.config": { + "vmArgs": [ + "-Djava.util.logging.config.file=src/test/resources/logging.properties", + "-Dtest.debug='true'", + "-Dcom.exasol.dockerdb.image=8.24.0" + ] + }, + "sonarlint.connectedMode.project": { + "connectionId": "exasol", + "projectKey": "com.exasol:snowflake-virtual-schema" + } +} \ No newline at end of file From 18b52c6785e72323a68a14cfd9a8746e3a7bb388 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Thu, 29 Aug 2024 06:38:05 -0400 Subject: [PATCH 03/57] fix version doc vert spacing --- doc/changes/changes_0.1.0.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/changes/changes_0.1.0.md b/doc/changes/changes_0.1.0.md index 59e0a4b..0400662 100644 --- a/doc/changes/changes_0.1.0.md +++ b/doc/changes/changes_0.1.0.md @@ -6,7 +6,8 @@ Code name: First version ## Features / Enhancements -* #1: SomethingSomething #TO DO +* #1: Something Something #TO DO + ## Dependency Updates ### Compile Dependency Updates From a9e9c1ea0dac0ab84bf453e7eb24230587f555a7 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Thu, 29 Aug 2024 06:52:21 -0400 Subject: [PATCH 04/57] Added summary --- doc/changes/changes_0.1.0.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/changes/changes_0.1.0.md b/doc/changes/changes_0.1.0.md index 0400662..14546ce 100644 --- a/doc/changes/changes_0.1.0.md +++ b/doc/changes/changes_0.1.0.md @@ -4,9 +4,11 @@ Code name: First version ## Summary -## Features / Enhancements +This is the MVP release. -* #1: Something Something #TO DO +## Features + +* #1: Releasing the MVP ## Dependency Updates From 39d02b2b64082f226fd1673f0ec31c22f9ff0cf7 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Thu, 29 Aug 2024 07:03:34 -0400 Subject: [PATCH 05/57] Fix release date --- doc/changes/changes_0.1.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changes/changes_0.1.0.md b/doc/changes/changes_0.1.0.md index 14546ce..5f578a2 100644 --- a/doc/changes/changes_0.1.0.md +++ b/doc/changes/changes_0.1.0.md @@ -1,4 +1,4 @@ -# Virtual Schema for Snowflake 0.1.0, released 2020-11-18 +# Virtual Schema for Snowflake 0.1.0, released 2024-??-?? Code name: First version From de099d4be20aa010dc6761f43b249ebee005f959 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Thu, 29 Aug 2024 07:12:40 -0400 Subject: [PATCH 06/57] fix dependency #s (why does PK not fix this automatically?) --- doc/changes/changes_0.1.0.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/changes/changes_0.1.0.md b/doc/changes/changes_0.1.0.md index 5f578a2..cdf405d 100644 --- a/doc/changes/changes_0.1.0.md +++ b/doc/changes/changes_0.1.0.md @@ -42,16 +42,16 @@ This is the MVP release. * Added `com.exasol:project-keeper-maven-plugin:4.3.3` * Added `io.github.zlika:reproducible-build-maven-plugin:0.16` * Added `org.apache.maven.plugins:maven-assembly-plugin:3.7.1` -* Added `org.apache.maven.plugins:maven-clean-plugin:3.2.0` +* Added `org.apache.maven.plugins:maven-clean-plugin:2.5` * Added `org.apache.maven.plugins:maven-compiler-plugin:3.13.0` * Added `org.apache.maven.plugins:maven-dependency-plugin:3.6.1` -* Added `org.apache.maven.plugins:maven-deploy-plugin:3.1.1` +* Added `org.apache.maven.plugins:maven-deploy-plugin:2.7` * Added `org.apache.maven.plugins:maven-enforcer-plugin:3.5.0` * Added `org.apache.maven.plugins:maven-failsafe-plugin:3.2.5` -* Added `org.apache.maven.plugins:maven-install-plugin:3.1.1` +* Added `org.apache.maven.plugins:maven-install-plugin:2.4` * Added `org.apache.maven.plugins:maven-jar-plugin:3.4.1` -* Added `org.apache.maven.plugins:maven-resources-plugin:3.3.1` -* Added `org.apache.maven.plugins:maven-site-plugin:3.12.1` +* Added `org.apache.maven.plugins:maven-resources-plugin:2.6` +* Added `org.apache.maven.plugins:maven-site-plugin:3.3` * Added `org.apache.maven.plugins:maven-surefire-plugin:3.2.5` * Added `org.apache.maven.plugins:maven-toolchains-plugin:3.2.0` * Added `org.basepom.maven:duplicate-finder-maven-plugin:2.0.1` @@ -60,4 +60,4 @@ This is the MVP release. * Added `org.codehaus.mojo:versions-maven-plugin:2.16.2` * Added `org.jacoco:jacoco-maven-plugin:0.8.12` * Added `org.sonarsource.scanner.maven:sonar-maven-plugin:4.0.0.4121` -* Added `org.sonatype.ossindex.maven:ossindex-maven-plugin:3.2.0` +* Added `org.sonatype.ossindex.maven:ossindex-maven-plugin:3.2.0` \ No newline at end of file From 2b350ac7e200ef09b783d1e4e859d1b34ea21fcf Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Wed, 4 Sep 2024 05:58:30 -0400 Subject: [PATCH 07/57] Added v1 of user guide --- doc/user_guide/snowflake_user_guide.md | 139 +++++++++++++++++++++++++ 1 file changed, 139 insertions(+) diff --git a/doc/user_guide/snowflake_user_guide.md b/doc/user_guide/snowflake_user_guide.md index e69de29..0400bff 100644 --- a/doc/user_guide/snowflake_user_guide.md +++ b/doc/user_guide/snowflake_user_guide.md @@ -0,0 +1,139 @@ +# Snowflake SQL Dialect User Guide + +[Snowflake](https://www.snowflake.com/) operates a platform that provides data storage via cloud computing and allows for data analysis. + +## Uploading the JDBC Driver to Exasol BucketFS + +1. Download the [SnowflakeJDBC driver](https://docs.snowflake.com/en/developer-guide/jdbc/jdbc-download). + +2. Upload the driver to BucketFS, see [BucketFS documentation](https://docs.exasol.com/db/latest/administration/on-premise/bucketfs/accessfiles.htm). + + Hint: Put the driver into folder `default/drivers/jdbc/` to register it for [ExaLoader](#registering-the-jdbc-driver-for-exaloader), too. + +## Registering the JDBC driver for ExaLoader + +In order to enable the ExaLoader to fetch data from the external database you must register the driver for ExaLoader as described in the [Installation procedure for JDBC drivers](https://github.com/exasol/docker-db/#installing-custom-jdbc-drivers). +1. ExaLoader expects the driver in BucketFS folder `default/drivers/jdbc`.
+ If you uploaded the driver for UDF to a different folder, then you need to [upload](#uploading-the-jdbc-driver-to-exasol-bucketfs) the driver again. +2. Additionally you need to create file `settings.cfg` and [upload](#uploading-the-jdbc-driver-to-exasol-bucketfs) it to the same folder in BucketFS: + +``` +DRIVERNAME=SNOWFLAKE_JDBC_DRIVER +JAR= +DRIVERMAIN=net.snowflake.client.jdbc.SnowflakeDriver +PREFIX=jdbc:snowflake: +FETCHSIZE=100000 +INSERTSIZE=-1 +``` + +| Variable | Description | +|----------|-----------------------------| +| `` | E.g. `snowflake-jdbc-3.16.1.jar` | + +## Installing the Adapter Script + +[Upload](https://docs.exasol.com/db/latest/administration/on-premise/bucketfs/accessfiles.htm) the latest available release of [Snowflake Virtual Schema JDBC Adapter](https://github.com/exasol/snowflake-virtual-schema/releases) to Bucket FS. + +Then create a schema to hold the adapter script. + +```sql +CREATE SCHEMA ADAPTER; +``` + +The SQL statement below creates the adapter script, defines the Java class that serves as entry point and tells the UDF framework where to find the libraries (JAR files) for Virtual Schema and database driver. + +```sql +--/ +CREATE OR REPLACE JAVA ADAPTER SCRIPT ADAPTER.JDBC_ADAPTER AS + %scriptclass com.exasol.adapter.RequestDispatcher; + %jar /buckets///virtual-schema-dist-12.0.0-snowflake-0.1.0.jar; +/ +``` + +## Defining a Named Connection + +Define the connection to the Snowflake database as shown below. We recommend using TLS to secure the connection. + +```sql +CREATE OR REPLACE CONNECTION SNOWFLAKE_CONNECTION +TO 'jdbc:snowflake://.snowflakecomputing.com' +USER '' +IDENTIFIED BY ''; +``` + +| Variable | Description | +|----------|-------------| + +| ` + USING ADAPTER.JDBC_ADAPTER + WITH + CATALOG_NAME = '' + SCHEMA_NAME = '' + CONNECTION_NAME = 'SNOWFLAKECONNECTION'; +``` + +| Variable | Description | +|----------|-----------------------------------------------------------------------------------------------------| +| `` | Name of the virtual schema you want to use. | +| `` | Name of the catalog, usally equivalent to the name of the Snowflake database. Please use UPPERCASE. | +| `` | Name of the database schema you want to use in the Snowflake database. Please use UPPERCASE. | + + +For additional parameters coming from the base library see also [Adapter Properties for JDBC-Based Virtual Schemas](https://github.com/exasol/virtual-schema-common-jdbc#adapter-properties-for-jdbc-based-virtual-schemas). + +## Data Types Conversion + +| Snowflake Data Type | Supported | Converted Exasol Data Type | Known limitations | +|--------------------------|--------------|---------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------| +| BIGINT | ✓ | DECIMAL(19,0) | | +| BIGSERIAL | ✓ | DECIMAL(19,0) | | +| BIT | ✓ | BOOLEAN | | +| BIT VARYING | ✓ | VARCHAR(5) | | +| BOX | ✓ | VARCHAR(2000000) | | +| BYTEA | ✓ | VARCHAR(2000000) | | +| BOOLEAN | ✓ | BOOLEAN | | +| CHARACTER | ✓ | CHAR | | +| CHARACTER VARYING | ✓ | VARCHAR | | +| CIDR | ✓ | VARCHAR(2000000) | | +| CIRCLE | ✓ | VARCHAR(2000000) | | +| DATE | ✓ | DATE | | +| DOUBLE PRECISION | ✓ | DOUBLE | | +| INET | ✓ | VARCHAR(2000000) | | +| INTEGER | ✓ | DECIMAL(10,0) | | +| INTERVAL | ✓ | VARCHAR(2000000) | | +| JSON | ✓ | VARCHAR(2000000) | | +| JSONB | ✓ | VARCHAR(2000000) | | +| LINE | ✓ | VARCHAR(2000000) | | +| LSEG | ✓ | VARCHAR(2000000) | | +| MACADDR | ✓ | VARCHAR(2000000) | | +| MONEY | ✓ | DOUBLE | | +| NUMERIC | ✓ | VARCHAR(2000000) | Stored in Exasol as VARCHAR, because Snowflake NUMERIC values can exceed Exasol Decimal limit which makes it impossible to use Virtual Schemas. | +| PATH | ✓ | VARCHAR(2000000) | | +| POINT | ✓ | VARCHAR(2000000) | | +| POLYGON | ✓ | VARCHAR(2000000) | | +| REAL | ✓ | DOUBLE | | +| SMALLINT | ✓ | DECIMAL(5,0) | | +| SMALLSERIAL | ? (untested) | | | +| SERIAL | ? (untested) | | | +| TEXT | ✓ | VARCHAR(2000000) | | +| TIME | ✓ | VARCHAR(2000000) | | +| TIME WITH TIME ZONE | ✓ | VARCHAR(2000000) | | +| TIMESTAMP | ✓ | TIMESTAMP | | +| TIMESTAMP WITH TIME ZONE | ✓ | TIMESTAMP | | +| TSQUERY | ✓ | VARCHAR(2000000) | | +| TSVECTOR | ✓ | VARCHAR(2000000) | | +| UUID | ✓ | VARCHAR(2000000) | | +| XML | ✓ | VARCHAR(2000000) | | From 1ae1eaf6ebaaefc7f8b67659f8404fd041070943 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Wed, 4 Sep 2024 05:59:30 -0400 Subject: [PATCH 08/57] minor cleanup --- .../SnowflakeVirtualSchemaIntegrationTestSetup.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java index 707cffe..1762efe 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java @@ -198,10 +198,6 @@ private AdapterScript createAdapterScript(final ExasolSchema schema) { return schema.createAdapterScript(ADAPTER_SCRIPT_EXASOL, JAVA, content); } - // public SnowflakeObjectFactory getSnowflakeFactory() { - // return this.snowflakeFactory; - // } - public Statement getSnowflakeStatement() { return this.snowflakeStatement; } @@ -219,7 +215,6 @@ public VirtualSchema createVirtualSchema(final String forSnowflakeSchema, // TODO add localstack support + cleanup final Map properties = new HashMap<>(Map.of("CATALOG_NAME", "TESTDB", // "SCHEMA_NAME", forSnowflakeSchema)); // - // "ACCOUNT_NAME", "bfcxnza-jg09523")); properties.putAll(additionalProperties); return this.exasolFactory .createVirtualSchemaBuilder("SNOWFLAKE_VIRTUAL_SCHEMA_" + (this.virtualSchemaCounter++)) From 347fe640bf774973da8551bcfb03b3fdb6ec8876 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Thu, 5 Sep 2024 04:53:35 -0400 Subject: [PATCH 09/57] fix link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8ffe367..99866f9 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ If you want to set up a Virtual Schema for a different database system, please h ### Information for Users * [Virtual Schema User Guide](https://docs.exasol.com/database_concepts/virtual_schemas.htm) -* [Snowflake Dialect User Guide](doc/user_guide/Snowflake_user_guide.md) +* [Snowflake Dialect User Guide](doc/user_guide/snowflake_user_guide.md) * [List of supported capabilities](doc/generated/capabilities.md) * [Changelog](doc/changes/changelog.md) * [Dependencies](dependencies.md) From 9181585e13678f30cfa225b37b1bad9f2c52135e Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Fri, 13 Sep 2024 05:45:26 -0400 Subject: [PATCH 10/57] Adjustments to user guide --- doc/user_guide/snowflake_user_guide.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/user_guide/snowflake_user_guide.md b/doc/user_guide/snowflake_user_guide.md index 0400bff..0c34aa3 100644 --- a/doc/user_guide/snowflake_user_guide.md +++ b/doc/user_guide/snowflake_user_guide.md @@ -24,7 +24,10 @@ DRIVERMAIN=net.snowflake.client.jdbc.SnowflakeDriver PREFIX=jdbc:snowflake: FETCHSIZE=100000 INSERTSIZE=-1 +NOSECURITY=YES + ``` +Make sure there's a newline at the end of the `settings.cfg` file, as shown above, or it will not be properly read out, the EXALoader will display an error message. | Variable | Description | |----------|-----------------------------| @@ -44,9 +47,10 @@ The SQL statement below creates the adapter script, defines the Java class that ```sql --/ -CREATE OR REPLACE JAVA ADAPTER SCRIPT ADAPTER.JDBC_ADAPTER AS +CREATE OR REPLACE JAVA ADAPTER SCRIPT ADAPTER.SNOWFLAKE_JDBC_ADAPTER AS %scriptclass com.exasol.adapter.RequestDispatcher; %jar /buckets///virtual-schema-dist-12.0.0-snowflake-0.1.0.jar; + %jar /buckets///drivers/jdbc/snowflake-jdbc-.jar; / ``` @@ -78,11 +82,11 @@ Use the following SQL command in Exasol database to create a Snowflake Virtual S ```sql CREATE VIRTUAL SCHEMA - USING ADAPTER.JDBC_ADAPTER + USING ADAPTER.SNOWFLAKE_JDBC_ADAPTER WITH CATALOG_NAME = '' SCHEMA_NAME = '' - CONNECTION_NAME = 'SNOWFLAKECONNECTION'; + CONNECTION_NAME = 'SNOWFLAKE_CONNECTION'; ``` | Variable | Description | From ee70cf220d435dcecd29d2a5be9bfdc1da3362d1 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Tue, 17 Sep 2024 06:21:21 -0400 Subject: [PATCH 11/57] Remove commented out code --- .../snowflake/SnowflakeColumnMetadataReader.java | 13 ------------- .../snowflake/SnowflakeSqlDialectTest.java | 9 --------- .../SnowflakeSqlGenerationVisitorTest.java | 12 ------------ .../SnowflakeTableMetadataReaderTest.java | 15 --------------- ...nowflakeVirtualSchemaIntegrationTestSetup.java | 5 ----- 5 files changed, 54 deletions(-) diff --git a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReader.java b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReader.java index ac24cb1..2dc8ecd 100644 --- a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReader.java +++ b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReader.java @@ -34,10 +34,6 @@ public SnowflakeColumnMetadataReader(final Connection connection, final AdapterP * * @return catalog name or null if metadata lookups are not limited by catalog */ -// @Override -// public String getCatalogNameFilter() { -// return this.properties.getDatabaseName(); -// } @Override public DataType mapJdbcType(final JDBCTypeDescription jdbcTypeDescription) { switch (jdbcTypeDescription.getJdbcType()) { @@ -70,20 +66,11 @@ protected boolean isVarBitColumn(final JDBCTypeDescription jdbcTypeDescription) @Override public String readColumnName(final ResultSet columns) throws SQLException { -// if (getIdentifierMapping().equals(CaseFolding.CONVERT_TO_UPPER)) { -// return super.readColumnName(columns).toUpperCase(); -// } else { return super.readColumnName(columns); -// } } @Override public String getSchemaNameFilter() { return this.properties.getSchemaName().toUpperCase(); - //return this.properties.getSchemaName().replace("_","\\_").toUpperCase(); } - -// CaseFolding getIdentifierMapping() { -// return SnowflakeIdentifierMapping.from(this.properties); -// } } \ No newline at end of file diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectTest.java b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectTest.java index eafa795..f268462 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectTest.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectTest.java @@ -86,15 +86,6 @@ void testGetCapabilities() { VAR_POP, VAR_POP_DISTINCT, VAR_SAMP, VAR_SAMP_DISTINCT, GROUP_CONCAT)) // ); } -/* - @CsvSource({ "ABC, \"abc\"", // - "AbCde, \"abcde\"", // - "\"tableName, \"\"\"tablename\"" // - }) - @ParameterizedTest - void testApplyQuote(final String unquoted, final String quoted) { - assertThat(this.dialect.applyQuote(unquoted), equalTo(quoted)); - }*/ @ValueSource(strings = { "ab:E'ab'", "a'b:E'a''b'", "a''b:E'a''''b'", "'ab':E'''ab'''", "a\\\\b:E'a\\\\\\\\b'", "a\\'b:E'a\\\\''b'" }) diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitorTest.java b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitorTest.java index a843d5b..1f9a7e5 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitorTest.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitorTest.java @@ -90,18 +90,6 @@ void testVisitSqlSelectListAnyValue() throws AdapterException { assertSqlNodeConvertedToOne(sqlSelectList, this.visitor); } -/* @Test - void testVisitSqlStatementSelect() throws AdapterException { - final SqlStatementSelect select = (SqlStatementSelect) DialectTestData.getTestSqlNode(); - assertThat(this.visitor.visit(select), // - equalTo("SELECT \"user_id\", " // - + "COUNT(\"url\") FROM \"test_schema\".\"clicks\" " // - + "WHERE 1 < \"user_id\" " // - + "GROUP BY \"user_id\" " // - + "HAVING 1 < COUNT(\"url\") " // - + "ORDER BY \"user_id\" LIMIT 10")); - }*/ - @Test void testVisitSqlFunctionAggregateGroupConcat() throws AdapterException { final SqlLiteralString argument = new SqlLiteralString("test"); diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeTableMetadataReaderTest.java b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeTableMetadataReaderTest.java index 7934c65..32f3682 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeTableMetadataReaderTest.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeTableMetadataReaderTest.java @@ -32,19 +32,4 @@ void beforeEach() { private void ignoreErrors(final String ignoreErrors) { this.rawProperties.put(IGNORE_ERRORS_PROPERTY, ignoreErrors); } - - - -/* @Test - void testIsUppercaseTableIncludedByMappingWithIgnoringUppercaseTables() { - ignoreErrors("SNOWFLAKE_UPPERCASE_TABLES"); - assertThat(this.reader.isTableIncludedByMapping("\"FooBar\""), equalTo(false)); - } - - @Test - void testIsUppercaseTableIncludedByMappingWithConvertToUpperNotIgnoringUppercaseTablesThrowsException() { - final RemoteMetadataReaderException exception = assertThrows(RemoteMetadataReaderException.class, - () -> this.reader.isTableIncludedByMapping("\"FooBar\"")); - assertThat(exception.getMessage(), containsString("E-VSSF-6")); - }*/ } \ No newline at end of file diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java index 1762efe..cd2b30b 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java @@ -38,8 +38,6 @@ public class SnowflakeVirtualSchemaIntegrationTestSetup implements Closeable { private static final String PASSWORD_FILE = "password.txt"; private static final String ACCOUNTNAME_FILE = "accountname.txt"; private final Statement snowflakeStatement; - // private final LocalStackContainer snowflakeContainer = new - // LocalStackContainer(DockerImageName.parse("localstack/snowflake")); private final ExasolContainer> exasolContainer = new ExasolContainer<>( EXASOL_DOCKER_IMAGE_REFERENCE).withRequiredServices(ExasolService.BUCKETFS, ExasolService.UDF) .withReuse(true); @@ -104,9 +102,6 @@ private ConnectionDefinition getSnowflakeConnectionDefinition(final String conne // TODO add localstack support + cleanup private String getSnowflakeConnectionString(final String accountname) { - // final String connectionString = "jdbc:snowflake://" + this.exasolContainer.getHostIp() + ":" - // + this.snowflakeContainer.getMappedPort(SNOWFLAKE_PORT) + "/" - // + this.snowflakeContainer.getDatabaseName(); final String connectionString = "jdbc:snowflake://" + accountname + ".snowflakecomputing.com"; return connectionString; } From 6dbf82da28e7b339b6869b024605694623229144 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Tue, 17 Sep 2024 06:21:37 -0400 Subject: [PATCH 12/57] Fix table formatting and small improvement. --- doc/user_guide/snowflake_user_guide.md | 94 +++++++++++++------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/doc/user_guide/snowflake_user_guide.md b/doc/user_guide/snowflake_user_guide.md index 0c34aa3..1ce757d 100644 --- a/doc/user_guide/snowflake_user_guide.md +++ b/doc/user_guide/snowflake_user_guide.md @@ -15,7 +15,7 @@ In order to enable the ExaLoader to fetch data from the external database you must register the driver for ExaLoader as described in the [Installation procedure for JDBC drivers](https://github.com/exasol/docker-db/#installing-custom-jdbc-drivers). 1. ExaLoader expects the driver in BucketFS folder `default/drivers/jdbc`.
If you uploaded the driver for UDF to a different folder, then you need to [upload](#uploading-the-jdbc-driver-to-exasol-bucketfs) the driver again. -2. Additionally you need to create file `settings.cfg` and [upload](#uploading-the-jdbc-driver-to-exasol-bucketfs) it to the same folder in BucketFS: +2. Additionally, you need to create file `settings.cfg` and [upload](#uploading-the-jdbc-driver-to-exasol-bucketfs) it to the same folder in BucketFS. Contents below: ``` DRIVERNAME=SNOWFLAKE_JDBC_DRIVER @@ -29,8 +29,8 @@ NOSECURITY=YES ``` Make sure there's a newline at the end of the `settings.cfg` file, as shown above, or it will not be properly read out, the EXALoader will display an error message. -| Variable | Description | -|----------|-----------------------------| +| Variable | Description | +|-----------------------------------------|----------------------------------| | `` | E.g. `snowflake-jdbc-3.16.1.jar` | ## Installing the Adapter Script @@ -89,11 +89,11 @@ CREATE VIRTUAL SCHEMA CONNECTION_NAME = 'SNOWFLAKE_CONNECTION'; ``` -| Variable | Description | -|----------|-----------------------------------------------------------------------------------------------------| +| Variable | Description | +|-------------------------|-----------------------------------------------------------------------------------------------------| | `` | Name of the virtual schema you want to use. | -| `` | Name of the catalog, usally equivalent to the name of the Snowflake database. Please use UPPERCASE. | -| `` | Name of the database schema you want to use in the Snowflake database. Please use UPPERCASE. | +| `` | Name of the catalog, usally equivalent to the name of the Snowflake database. Please use UPPERCASE. | +| `` | Name of the database schema you want to use in the Snowflake database. Please use UPPERCASE. | For additional parameters coming from the base library see also [Adapter Properties for JDBC-Based Virtual Schemas](https://github.com/exasol/virtual-schema-common-jdbc#adapter-properties-for-jdbc-based-virtual-schemas). @@ -101,43 +101,43 @@ For additional parameters coming from the base library see also [Adapter Propert ## Data Types Conversion | Snowflake Data Type | Supported | Converted Exasol Data Type | Known limitations | -|--------------------------|--------------|---------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------| -| BIGINT | ✓ | DECIMAL(19,0) | | -| BIGSERIAL | ✓ | DECIMAL(19,0) | | -| BIT | ✓ | BOOLEAN | | -| BIT VARYING | ✓ | VARCHAR(5) | | -| BOX | ✓ | VARCHAR(2000000) | | -| BYTEA | ✓ | VARCHAR(2000000) | | -| BOOLEAN | ✓ | BOOLEAN | | -| CHARACTER | ✓ | CHAR | | -| CHARACTER VARYING | ✓ | VARCHAR | | -| CIDR | ✓ | VARCHAR(2000000) | | -| CIRCLE | ✓ | VARCHAR(2000000) | | -| DATE | ✓ | DATE | | -| DOUBLE PRECISION | ✓ | DOUBLE | | -| INET | ✓ | VARCHAR(2000000) | | -| INTEGER | ✓ | DECIMAL(10,0) | | -| INTERVAL | ✓ | VARCHAR(2000000) | | -| JSON | ✓ | VARCHAR(2000000) | | -| JSONB | ✓ | VARCHAR(2000000) | | -| LINE | ✓ | VARCHAR(2000000) | | -| LSEG | ✓ | VARCHAR(2000000) | | -| MACADDR | ✓ | VARCHAR(2000000) | | -| MONEY | ✓ | DOUBLE | | -| NUMERIC | ✓ | VARCHAR(2000000) | Stored in Exasol as VARCHAR, because Snowflake NUMERIC values can exceed Exasol Decimal limit which makes it impossible to use Virtual Schemas. | -| PATH | ✓ | VARCHAR(2000000) | | -| POINT | ✓ | VARCHAR(2000000) | | -| POLYGON | ✓ | VARCHAR(2000000) | | -| REAL | ✓ | DOUBLE | | -| SMALLINT | ✓ | DECIMAL(5,0) | | -| SMALLSERIAL | ? (untested) | | | -| SERIAL | ? (untested) | | | -| TEXT | ✓ | VARCHAR(2000000) | | -| TIME | ✓ | VARCHAR(2000000) | | -| TIME WITH TIME ZONE | ✓ | VARCHAR(2000000) | | -| TIMESTAMP | ✓ | TIMESTAMP | | -| TIMESTAMP WITH TIME ZONE | ✓ | TIMESTAMP | | -| TSQUERY | ✓ | VARCHAR(2000000) | | -| TSVECTOR | ✓ | VARCHAR(2000000) | | -| UUID | ✓ | VARCHAR(2000000) | | -| XML | ✓ | VARCHAR(2000000) | | +|--------------------------|--------------|----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------| +| BIGINT | ✓ | DECIMAL(19,0) | | +| BIGSERIAL | ✓ | DECIMAL(19,0) | | +| BIT | ✓ | BOOLEAN | | +| BIT VARYING | ✓ | VARCHAR(5) | | +| BOX | ✓ | VARCHAR(2000000) | | +| BYTEA | ✓ | VARCHAR(2000000) | | +| BOOLEAN | ✓ | BOOLEAN | | +| CHARACTER | ✓ | CHAR | | +| CHARACTER VARYING | ✓ | VARCHAR | | +| CIDR | ✓ | VARCHAR(2000000) | | +| CIRCLE | ✓ | VARCHAR(2000000) | | +| DATE | ✓ | DATE | | +| DOUBLE PRECISION | ✓ | DOUBLE | | +| INET | ✓ | VARCHAR(2000000) | | +| INTEGER | ✓ | DECIMAL(10,0) | | +| INTERVAL | ✓ | VARCHAR(2000000) | | +| JSON | ✓ | VARCHAR(2000000) | | +| JSONB | ✓ | VARCHAR(2000000) | | +| LINE | ✓ | VARCHAR(2000000) | | +| LSEG | ✓ | VARCHAR(2000000) | | +| MACADDR | ✓ | VARCHAR(2000000) | | +| MONEY | ✓ | DOUBLE | | +| NUMERIC | ✓ | VARCHAR(2000000) | Stored in Exasol as VARCHAR, because Snowflake NUMERIC values can exceed Exasol Decimal limit which makes it impossible to use Virtual Schemas. | +| PATH | ✓ | VARCHAR(2000000) | | +| POINT | ✓ | VARCHAR(2000000) | | +| POLYGON | ✓ | VARCHAR(2000000) | | +| REAL | ✓ | DOUBLE | | +| SMALLINT | ✓ | DECIMAL(5,0) | | +| SMALLSERIAL | ? (untested) | | | +| SERIAL | ? (untested) | | | +| TEXT | ✓ | VARCHAR(2000000) | | +| TIME | ✓ | VARCHAR(2000000) | | +| TIME WITH TIME ZONE | ✓ | VARCHAR(2000000) | | +| TIMESTAMP | ✓ | TIMESTAMP | | +| TIMESTAMP WITH TIME ZONE | ✓ | TIMESTAMP | | +| TSQUERY | ✓ | VARCHAR(2000000) | | +| TSVECTOR | ✓ | VARCHAR(2000000) | | +| UUID | ✓ | VARCHAR(2000000) | | +| XML | ✓ | VARCHAR(2000000) | | From 52d8787180d882c3b2207e8e60a68b47063e8223 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Fri, 20 Sep 2024 06:45:09 -0400 Subject: [PATCH 13/57] Added different mapping and conversions for: - timestamp with timezone -> timezone - warning for NUMBER with precision > 36 - 'character' is an alias for varchar in snowflake so it gets converted to varchar and there's no padding --- .../SnowflakeColumnMetadataReader.java | 4 +++ .../SnowflakeSqlGenerationVisitor.java | 29 +++++++++++++++---- .../snowflake/SnowflakeSqlDialectIT.java | 14 ++++----- 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReader.java b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReader.java index 2dc8ecd..da88670 100644 --- a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReader.java +++ b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReader.java @@ -10,6 +10,8 @@ import com.exasol.adapter.jdbc.JDBCTypeDescription; import com.exasol.adapter.metadata.DataType; +import static com.exasol.adapter.metadata.DataType.ExaCharset.UTF8; + /** * This class implements Snowflake-specific reading of column metadata. */ @@ -43,6 +45,8 @@ public DataType mapJdbcType(final JDBCTypeDescription jdbcTypeDescription) { case Types.DISTINCT: case Types.BINARY: return DataType.createMaximumSizeVarChar(DataType.ExaCharset.UTF8); + case Types.TIMESTAMP_WITH_TIMEZONE: + return DataType.createTimestamp(false); default: return super.mapJdbcType(jdbcTypeDescription); } diff --git a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitor.java b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitor.java index 7d48a29..9f45ccd 100644 --- a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitor.java +++ b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitor.java @@ -3,9 +3,13 @@ import java.util.*; import com.exasol.adapter.AdapterException; +import com.exasol.adapter.adapternotes.ColumnAdapterNotes; +import com.exasol.adapter.adapternotes.ColumnAdapterNotesJsonConverter; import com.exasol.adapter.dialects.SqlDialect; import com.exasol.adapter.dialects.rewriting.SqlGenerationContext; import com.exasol.adapter.dialects.rewriting.SqlGenerationVisitor; +import com.exasol.adapter.metadata.ColumnMetadata; +import com.exasol.adapter.metadata.DataType; import com.exasol.adapter.sql.*; /** @@ -48,9 +52,18 @@ public String visit(final SqlColumn column) throws AdapterException { private String getColumnProjectionString(final SqlColumn column, final String projectionString) throws AdapterException { - return super.isDirectlyInSelectList(column) // - ? buildColumnProjectionString(getTypeNameFromColumn(column), projectionString) // - : projectionString; + + if (super.isDirectlyInSelectList(column)) { // + final ColumnAdapterNotesJsonConverter converter = ColumnAdapterNotesJsonConverter.getInstance(); + ColumnMetadata metaData = column.getMetadata(); + DataType mappedType = metaData.getType(); + ColumnAdapterNotes columnAdapterNotes= converter.convertFromJsonToColumnAdapterNotes(metaData.getAdapterNotes(), column.getName()); + String sourceTypeName = columnAdapterNotes.getTypeName(); + + return buildColumnProjectionString(sourceTypeName,mappedType, projectionString); // + } else { + return projectionString; + } } @Override @@ -167,8 +180,14 @@ private String getPosixTime(final List argumentsSql) { return "EXTRACT(EPOCH FROM " + argumentsSql.get(0) + ")"; } - private String buildColumnProjectionString(final String typeName, final String projectionString) { - if (checkIfNeedToCastToVarchar(typeName)) { + private String buildColumnProjectionString(final String typeName,DataType mappedType, final String projectionString) { + if (typeName.startsWith("NUMBER") && mappedType.getExaDataType() == DataType.ExaDataType.VARCHAR ){ + return "'Number precision not supported'"; + } + else if (typeName.startsWith("TIMESTAMPTZ")) { + return "TO_TIMESTAMP_NTZ(" + projectionString +")"; + } + else if (checkIfNeedToCastToVarchar(typeName)) { return "CAST(" + projectionString + " as VARCHAR )"; } else if (typeName.startsWith("smallserial")) { return "CAST(" + projectionString + " as SMALLINT )"; diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectIT.java b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectIT.java index 9dcf1c0..1b76fe2 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectIT.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectIT.java @@ -7,8 +7,9 @@ import java.sql.*; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.*; import java.util.Date; +import java.util.List; +import java.util.Map; import java.util.stream.Collectors; import org.hamcrest.MatcherAssert; @@ -85,7 +86,7 @@ private static void createSnowflakeTestTableAllDataTypes(final Statement stateme + "myBoolean BOOLEAN, " // // + "myBox BOX, " // // + "myBytea BYTEA, " // - + "myCharacter CHARACTER(1000), " // + + "myCharacter CHARACTER(1000), " // ALIAS FOR NVARCHAR IN SNOWFLAKE, SAME THING, NO PADDING + "myCharacterVar CHARACTER, " // // + "myCidr CIDR, " // // + "myCircle CIRCLE, " // @@ -306,7 +307,7 @@ void testCountAll() throws SQLException { @Test void testDatatypeBigint() throws SQLException { - assertSingleValue("myBigint", "DECIMAL(19,0)", "10000000000"); + assertSingleValue("myBigint", "VARCHAR(2000000) UTF8", "Number precision not supported"); } @Test @@ -316,9 +317,8 @@ void testDatatypeBoolean() throws SQLException { @Test void testDatatypeCharacter() throws SQLException { - final String empty = " "; - final String expected = "hajksdf" + String.join("", Collections.nCopies(993, empty)); - assertSingleValue("myCharacter", "CHAR(1000) UTF8", expected); + final String expected = "hajksdf"; + assertSingleValue("myCharacter", "VARCHAR(1000) UTF8", expected); } @Test @@ -354,7 +354,7 @@ void testDatatypeReal() throws SQLException { @Test void testDatatypeSmallInt() throws SQLException { - assertSingleValue("mySmallint", "DECIMAL(5,0)", 100); + assertSingleValue("mySmallint", "VARCHAR(2000000) UTF8", "Number precision not supported"); } @Test From cd391867ffd65a2fd6bcc7246b036a50086111bc Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Fri, 20 Sep 2024 08:12:24 -0400 Subject: [PATCH 14/57] fix error code config, add snowflake package --- error_code_config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/error_code_config.yml b/error_code_config.yml index 08ef8cc..71b9803 100644 --- a/error_code_config.yml +++ b/error_code_config.yml @@ -1,5 +1,6 @@ error-tags: VSSF: packages: + - com.exasol.adapter.dialects.snowflake - com.exasol.closeafterall highest-index: 9 From 3f6dfa0af081bc20a9eba282fa2e8b8f54ecc5e2 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Fri, 20 Sep 2024 08:43:26 -0400 Subject: [PATCH 15/57] add randomised db name addendum to allow for simultaneous integration test runs. --- .../snowflake/SnowflakeSqlDialectIT.java | 12 ++++++++- ...lakeVirtualSchemaIntegrationTestSetup.java | 26 ++++++++++++++++--- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectIT.java b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectIT.java index 1b76fe2..c98ee16 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectIT.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectIT.java @@ -45,7 +45,7 @@ class SnowflakeSqlDialectIT { static void beforeAll() throws SQLException { final Statement statementSnowflake = SETUP.getSnowflakeStatement(); try { - statementSnowflake.execute("CREATE DATABASE " + "TESTDB"); + statementSnowflake.execute("CREATE DATABASE " + SETUP.getDatabaseName()); } catch (final Exception e) { } @@ -68,6 +68,16 @@ static void beforeAll() throws SQLException { exasolSchema = SETUP.getExasolFactory().createSchema("EXASOL_TEST_SCHEMA"); } + @AfterAll + static void afterAll() throws SQLException { + final Statement statementSnowflake = SETUP.getSnowflakeStatement(); + try { + statementSnowflake.execute("DROP DATABASE " + SETUP.getDatabaseName() + " CASCADE;"); + } catch (final Exception e) { + + } + } + private static void createSnowflakeTestTableSimple(final Statement statementSnowflake) throws SQLException { final String qualifiedTableName = SCHEMA_SNOWFLAKE + "." + TABLE_SNOWFLAKE_SIMPLE; statementSnowflake.execute("CREATE TABLE " + qualifiedTableName + " (x NUMBER(36,0))"); diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java index cd2b30b..d67f0ba 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java @@ -52,9 +52,27 @@ public class SnowflakeVirtualSchemaIntegrationTestSetup implements Closeable { private String userName; private String password; private String accountName; + private String databaseName; + + public String randomDbAddendum() { + final int leftLimit = 97; // letter 'a' + final int rightLimit = 122; // letter 'z' + final int targetStringLength = 4; + final Random random = new Random(); + + final String generatedString = random.ints(leftLimit, rightLimit + 1).limit(targetStringLength) + .collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append).toString(); + + return generatedString; + } + + public String getDatabaseName() { + return databaseName; + } SnowflakeVirtualSchemaIntegrationTestSetup() { try { + this.databaseName = "TESTDB" + randomDbAddendum().toUpperCase(); this.exasolContainer.start(); // TODO add localstack support // this.snowflakeContainer.start(); @@ -107,8 +125,8 @@ private String getSnowflakeConnectionString(final String accountname) { } // TODO add localstack support + cleanup - private static Connection getSnowflakeConnection(final String username, final String password, - final String accountname) throws SQLException { + private Connection getSnowflakeConnection(final String username, final String password, final String accountname) + throws SQLException { // TODO refactor this whole thing and remove secrets + add localstack support try { Class.forName("net.snowflake.client.jdbc.SnowflakeDriver"); @@ -121,7 +139,7 @@ private static Connection getSnowflakeConnection(final String username, final St properties.put("user", username); // replace "" with your username properties.put("password", password); // replace "" with your password properties.put("account", accountname); // replace "" with your account name - properties.put("db", "TESTDB"); // replace "" with target database name + properties.put("db", this.databaseName); // replace "" with target database name properties.put("schema", "TESTSCHEMA"); // replace "" with target schema name // properties.put("tracing", "on"); @@ -208,7 +226,7 @@ public ExasolContainer> getExasolContainer() { public VirtualSchema createVirtualSchema(final String forSnowflakeSchema, final Map additionalProperties) { // TODO add localstack support + cleanup - final Map properties = new HashMap<>(Map.of("CATALOG_NAME", "TESTDB", // + final Map properties = new HashMap<>(Map.of("CATALOG_NAME", databaseName, // "SCHEMA_NAME", forSnowflakeSchema)); // properties.putAll(additionalProperties); return this.exasolFactory From c22ae4bde43a06cf4a4920d492c5db41d97ae396 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Mon, 23 Sep 2024 04:57:10 -0400 Subject: [PATCH 16/57] Remove link to capabilities for now as SIT not added to project yet. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 99866f9..0d79772 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,6 @@ If you want to set up a Virtual Schema for a different database system, please h * [Virtual Schema User Guide](https://docs.exasol.com/database_concepts/virtual_schemas.htm) * [Snowflake Dialect User Guide](doc/user_guide/snowflake_user_guide.md) -* [List of supported capabilities](doc/generated/capabilities.md) * [Changelog](doc/changes/changelog.md) * [Dependencies](dependencies.md) From ed7d94be52df51537dcab9b90801c97d87c122ce Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Mon, 23 Sep 2024 04:57:38 -0400 Subject: [PATCH 17/57] Add credentials step to release workflow --- .github/workflows/release.yml | 11 +++++++++++ .project-keeper.yml | 17 +++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2a8bbf7..b7a2687 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -104,6 +104,17 @@ jobs: env: { GITHUB_TOKEN: '${{ github.token }}' } + - name: Configure Snowflake credentials + id: configure-snowflake-credentials + run: | + echo "$USERNAME" > username.txt + echo "$ACCOUNTNAME" > accountname.txt + echo "$PASSWORD" > password.txt + env: { + USERNAME: '${{ secrets.USERNAME }}', + ACCOUNTNAME: '${{ secrets.ACCOUNTNAME }}', + PASSWORD: '${{ secrets.PASSWORD }}' + } - { name: Build project, id: build, diff --git a/.project-keeper.yml b/.project-keeper.yml index 06d9890..c2672a3 100644 --- a/.project-keeper.yml +++ b/.project-keeper.yml @@ -19,6 +19,23 @@ build: # Configure Snowflake credentials - action: INSERT_AFTER stepId: enable-testcontainer-reuse + content: + name: Configure Snowflake credentials + id: configure-snowflake-credentials + run: | + echo "$USERNAME" > username.txt + echo "$ACCOUNTNAME" > accountname.txt + echo "$PASSWORD" > password.txt + env: { + USERNAME: '${{ secrets.USERNAME }}', + ACCOUNTNAME: '${{ secrets.ACCOUNTNAME }}', + PASSWORD: '${{ secrets.PASSWORD }}' + } + - name: release.yml + stepCustomizations: + # Configure Snowflake credentials + - action: INSERT_AFTER + stepId: verify-release content: name: Configure Snowflake credentials id: configure-snowflake-credentials From 7f6ee5a01dafb1847cefe442c53832296acc091d Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Mon, 23 Sep 2024 04:57:54 -0400 Subject: [PATCH 18/57] Add release date --- doc/changes/changes_0.1.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changes/changes_0.1.0.md b/doc/changes/changes_0.1.0.md index cdf405d..273152d 100644 --- a/doc/changes/changes_0.1.0.md +++ b/doc/changes/changes_0.1.0.md @@ -1,4 +1,4 @@ -# Virtual Schema for Snowflake 0.1.0, released 2024-??-?? +# Virtual Schema for Snowflake 0.1.0, released 2024-09-23 Code name: First version From 10c2417b40b6bfbd818da3e7a60b14e2a0be8871 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Tue, 24 Sep 2024 09:12:08 -0400 Subject: [PATCH 19/57] cleanup todos + code in comments + formatting --- .../SnowflakeColumnMetadataReader.java | 3 - .../snowflake/SnowflakeSqlDialect.java | 1 - .../snowflake/SnowflakeSqlDialectIT.java | 57 ++----------------- ...lakeVirtualSchemaIntegrationTestSetup.java | 23 ++------ 4 files changed, 9 insertions(+), 75 deletions(-) diff --git a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReader.java b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReader.java index da88670..f2f9ae2 100644 --- a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReader.java +++ b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReader.java @@ -5,13 +5,10 @@ import com.exasol.adapter.AdapterProperties; import com.exasol.adapter.dialects.IdentifierConverter; -//import com.exasol.adapter.dialects.snowflake.SnowflakeIdentifierMapping.CaseFolding; import com.exasol.adapter.jdbc.BaseColumnMetadataReader; import com.exasol.adapter.jdbc.JDBCTypeDescription; import com.exasol.adapter.metadata.DataType; -import static com.exasol.adapter.metadata.DataType.ExaCharset.UTF8; - /** * This class implements Snowflake-specific reading of column metadata. */ diff --git a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialect.java b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialect.java index 7c2574c..312b63c 100644 --- a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialect.java +++ b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialect.java @@ -100,7 +100,6 @@ private static ScalarFunctionCapability[] getEnabledScalarFunctionCapabilities() */ public SnowflakeSqlDialect(final ConnectionFactory connectionFactory, final AdapterProperties properties) { super(connectionFactory, properties, // - //Set.of(SCHEMA_NAME_PROPERTY, DATABASE_NAME_PROPERTY, ACCOUNT_NAME_PROPERTY), // Set.of(SCHEMA_NAME_PROPERTY, CATALOG_NAME_PROPERTY, ACCOUNT_NAME_PROPERTY), // List.of()); } diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectIT.java b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectIT.java index c98ee16..9507be4 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectIT.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectIT.java @@ -23,7 +23,7 @@ import com.exasol.matcher.TypeMatchMode; @Tag("integration") -@ExtendWith({ CloseAfterAllExtension.class }) +@ExtendWith({CloseAfterAllExtension.class}) class SnowflakeSqlDialectIT { @CloseAfterAll private static final SnowflakeVirtualSchemaIntegrationTestSetup SETUP = new SnowflakeVirtualSchemaIntegrationTestSetup(); @@ -90,86 +90,37 @@ private static void createSnowflakeTestTableAllDataTypes(final Statement stateme final String createAllDatatypesTableStatement = "CREATE TABLE " + qualifiedTableName // + " (" // + "myBigint BIGINT, " // - // + "myBigserial BIGSERIAL, " //does not exist in SNOWFLAKE - // + "myBit BIT, " //BIT does not exist in SNOWFLAKE, use INT instead - // + "myBitVar BIT, " //BIT does not exist in SNOWFLAKE, use INT instead + "myBoolean BOOLEAN, " // - // + "myBox BOX, " // - // + "myBytea BYTEA, " // + "myCharacter CHARACTER(1000), " // ALIAS FOR NVARCHAR IN SNOWFLAKE, SAME THING, NO PADDING + "myCharacterVar CHARACTER, " // - // + "myCidr CIDR, " // - // + "myCircle CIRCLE, " // + "myDate DATE, " // + "myDouble DOUBLE PRECISION, " // - // + "myInet INET, " // - + "myInteger NUMBER(36,0), " // INT (EGER) has (38,0) precision and scale in snowflake, Exasol has - // (36,0) - // as a max. The integer datatype causes problems with the EXALOADER. - // TODO: demonstrate this to TB - // + "myInterval INTERVAL, " // - // + "myJson JSON, " // - // + "myJsonB JSONB, " // - // + "myLine LINE, " // - // + "myLseg LSEG, " // - // + "myMacAddr MACADDR, " // - // + "myMoney MONEY, " // + + "myInteger NUMBER(36,0), " // INT(EGER) has (38,0) precision and scale in snowflake, Exasol has (36,0) as a max. The integer datatype causes problems with the EXALOADER. + "myNumeric NUMERIC(36, 10), " // same as NUMBER IN snowflake - // + "myPath PATH, " // - // + "myPoint POINT, " // - // + "myPolygon POLYGON, " // + "myReal REAL, " // + "mySmallint SMALLINT, " // + "myText TEXT, " // + "myTime TIME, " // - // + "myTimeWithTimeZone TIME WITH TIME ZONE, " //DOES NOT EXIST IN SNOWFLAKE + // TIME WITH TIME ZONE DOES NOT EXIST IN SNOWFLAKE + "myTimestamp TIMESTAMP, " // + "myTimestampWithTimeZone TIMESTAMP_TZ " // TIMESTAMP WITH TIME ZONE - // + "myTsquery TSQUERY, " // - // + "myTsvector VECTOR, " // - // + "myUuid UUID, " //SUBTYPE OF STRING IN SNOWFLAKE - // + "myXml XML " //DOES NOT EXIST IN SNOWFLAKE + ")"; statementSnowflake.execute(createAllDatatypesTableStatement); final String fillAllDatabaseTypesStatement = ("INSERT INTO " + qualifiedTableName + " VALUES (" // + "10000000000, " // myBigint - // + "nextval('" + qualifiedTableName + "_myBigserial_seq'::regclass), " // myBigserial - // + "B'1', " // myBit - // + "B'0', " // myBitVar + "false, " // myBoolean - // + "'( ( 1 , 8 ) , ( 4 , 16 ) )', " // myBox - // + "E'\\\\000'::bytea, " // myBytea + "'hajksdf', " // myCharacter - + "'h', " // myCharacterVar - // + "'192.168.100.128/25'::cidr, " // myCidr - // + "'( ( 1 , 5 ) , 3 )'::circle, " // myCircle + + "'h', " // myCharacterVar // + "'192.168.100.128/25'::cidr, " // myCidr + "'2010-01-01', " // myDate + "192189234.1723854, " // myDouble - // + "'192.168.100.128'::inet, " // myInet + "7189234, " // myInteger - // + "INTERVAL '1' YEAR, " // myInterval - // + "'{\"bar\": \"baz\", \"balance\": 7.77, \"active\": false}'::json, " // myJson - // + "'{\"bar\": \"baz\", \"balance\": 7.77, \"active\": false}'::jsonb, " // myJsonB - // + "'{ 1, 2, 3 }'::line, " // myLine - // + "'[ ( 1 , 2 ) , ( 3 , 4 ) ]'::lseg, " // myLseg - // + "'08:00:2b:01:02:03'::macaddr, " // myMacAddr - // + "100.01, " // myMoney + "24.23, " // myNumeric - // + "'[ ( 1 , 2 ) , ( 3 , 4 ) ]'::path, " // myPath - // + "'( 1 , 3 )'::point, " // myPoint - // + "'( ( 1 , 2 ) , (2,4),(3,7) )'::polygon, " // myPolygon + "10.12, " // myReal + "100, " // mySmallint + "'This cat is super cute', " // myText + "'11:11:11', " // myTime - // + "'11:11:11 +01:00', " // myTimeWithTimeZone + "'2010-01-01 11:11:11', " // myTimestamp + "'2010-01-01 11:11:11 +01:00' " // myTimestampwithtimezone - // + "'fat & rat'::tsquery, " // myTsquery - // + "VECTOR('english', 'The Fat Rats'), " // myTsvector - // + "'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'::uuid, " // myUuid - // + "XMLPARSE (DOCUMENT 'Manual...') " // myXml + ")"); statementSnowflake.execute(fillAllDatabaseTypesStatement); } diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java index d67f0ba..fb52f02 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java @@ -46,7 +46,6 @@ public class SnowflakeVirtualSchemaIntegrationTestSetup implements Closeable { private final AdapterScript adapterScript; private final ConnectionDefinition connectionDefinition; private final ExasolObjectFactory exasolFactory; - // private final SnowflakeObjectFactory snowflakeFactory; private final Connection snowflakeConnection; private int virtualSchemaCounter = 0; private String userName; @@ -74,18 +73,14 @@ public String getDatabaseName() { try { this.databaseName = "TESTDB" + randomDbAddendum().toUpperCase(); this.exasolContainer.start(); - // TODO add localstack support - // this.snowflakeContainer.start(); final Bucket bucket = this.exasolContainer.getDefaultBucket(); uploadDriverToBucket(this.exasolContainer); uploadVsJarToBucket(bucket); this.exasolConnection = this.exasolContainer.createConnection(""); this.exasolStatement = this.exasolConnection.createStatement(); getTestCredentials(); - // TODO add localstack support + cleanup - this.snowflakeConnection = getSnowflakeConnection(userName, password, accountName);// this.snowflakeContainer.createConnection(""); - this.snowflakeStatement = snowflakeConnection.createStatement();// this.snowflakeConnection.createStatement(); - + this.snowflakeConnection = getSnowflakeConnection(userName, password, accountName); + this.snowflakeStatement = snowflakeConnection.createStatement(); final String hostIpAddress = getTestHostIpFromInsideExasol(); assert (hostIpAddress != null); final UdfTestSetup udfTestSetup = new UdfTestSetup(hostIpAddress, this.exasolContainer.getDefaultBucket(), @@ -93,11 +88,8 @@ public String getDatabaseName() { this.exasolFactory = new ExasolObjectFactory(this.exasolContainer.createConnection(""), ExasolObjectConfiguration.builder().withJvmOptions(udfTestSetup.getJvmOptions()).build()); final ExasolSchema exasolSchema = this.exasolFactory.createSchema(SCHEMA_EXASOL); - // this.snowflakeFactory = new SnowflakeObjectFactory(this.snowflakeConnection); this.adapterScript = createAdapterScript(exasolSchema); - // TODO add localstack support + cleanup final String connectionString = getSnowflakeConnectionString(accountName); - // TODO add localstack support + cleanup connectionDefinition = getSnowflakeConnectionDefinition(connectionString, userName, password); } catch (final SQLException | BucketAccessException | TimeoutException exception) { throw new IllegalStateException("Failed to created snowflake test setup.", exception); @@ -109,25 +101,21 @@ public String getDatabaseName() { } } - // TODO add localstack support + cleanup private ConnectionDefinition getSnowflakeConnectionDefinition(final String connectionString, final String username, - final String password) { + final String password) { final ConnectionDefinition connectionDefinition; connectionDefinition = this.exasolFactory.createConnectionDefinition("SNOWFLAKE_CONNECTION", connectionString, username, password); return connectionDefinition; } - // TODO add localstack support + cleanup private String getSnowflakeConnectionString(final String accountname) { final String connectionString = "jdbc:snowflake://" + accountname + ".snowflakecomputing.com"; return connectionString; } - // TODO add localstack support + cleanup private Connection getSnowflakeConnection(final String username, final String password, final String accountname) throws SQLException { - // TODO refactor this whole thing and remove secrets + add localstack support try { Class.forName("net.snowflake.client.jdbc.SnowflakeDriver"); } catch (final ClassNotFoundException ex) { @@ -147,8 +135,7 @@ private Connection getSnowflakeConnection(final String username, final String pa String connectStr = System.getenv("SF_JDBC_CONNECT_STRING"); // use the default connection string if it is not set in environment if (connectStr == null) { - connectStr = "jdbc:snowflake://" + accountname + ".snowflakecomputing.com"; // replace accountName with your - // account name + connectStr = "jdbc:snowflake://" + accountname + ".snowflakecomputing.com"; // replace accountName with your account name } return DriverManager.getConnection(connectStr, properties); } @@ -224,7 +211,7 @@ public ExasolContainer> getExasolContainer() { } public VirtualSchema createVirtualSchema(final String forSnowflakeSchema, - final Map additionalProperties) { + final Map additionalProperties) { // TODO add localstack support + cleanup final Map properties = new HashMap<>(Map.of("CATALOG_NAME", databaseName, // "SCHEMA_NAME", forSnowflakeSchema)); // From 935cbd1c20f5f7c3bd6bf3f2501f9a6fe4c896bf Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Tue, 24 Sep 2024 09:12:39 -0400 Subject: [PATCH 20/57] Changed release date --- doc/changes/changes_0.1.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changes/changes_0.1.0.md b/doc/changes/changes_0.1.0.md index 273152d..46e5352 100644 --- a/doc/changes/changes_0.1.0.md +++ b/doc/changes/changes_0.1.0.md @@ -1,4 +1,4 @@ -# Virtual Schema for Snowflake 0.1.0, released 2024-09-23 +# Virtual Schema for Snowflake 0.1.0, released 2024-09-24 Code name: First version From 8c79371b1d2fbc6295c4c334b5d62937ed83ddcf Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Wed, 25 Sep 2024 03:55:04 -0400 Subject: [PATCH 21/57] set release date --- doc/changes/changes_0.1.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changes/changes_0.1.0.md b/doc/changes/changes_0.1.0.md index 46e5352..d015703 100644 --- a/doc/changes/changes_0.1.0.md +++ b/doc/changes/changes_0.1.0.md @@ -1,4 +1,4 @@ -# Virtual Schema for Snowflake 0.1.0, released 2024-09-24 +# Virtual Schema for Snowflake 0.1.0, released 2024-09-25 Code name: First version From 6e8561d21e00fd1fe9dfa85ff741fc7a057933ce Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Wed, 25 Sep 2024 03:57:20 -0400 Subject: [PATCH 22/57] Update changes doc to make it a little less cryptic. --- doc/changes/changes_0.1.0.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/changes/changes_0.1.0.md b/doc/changes/changes_0.1.0.md index d015703..9bd4687 100644 --- a/doc/changes/changes_0.1.0.md +++ b/doc/changes/changes_0.1.0.md @@ -1,14 +1,16 @@ # Virtual Schema for Snowflake 0.1.0, released 2024-09-25 -Code name: First version +Code name: First version of the Snowflake virtual schema ## Summary -This is the MVP release. +This is the first version of the virtual schema for Snowflake. +There might still be issues and the project is subject to further testing. +Consider this a first and early-access release. ## Features -* #1: Releasing the MVP +* #1: Releasing the MVP (minimum viable product) ## Dependency Updates From b61350793053285e234b41b5d8cab22aa3130d95 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Thu, 26 Sep 2024 06:59:14 -0400 Subject: [PATCH 23/57] PR review feedback (1) - update .gitattributes - remove stale todo comments - update exasolDbversions in project-keeper.yml --- .gitattributes | 4 +--- .github/workflows/ci-build.yml | 6 +++--- .project-keeper.yml | 4 ++-- .../SnowflakeVirtualSchemaIntegrationTestSetup.java | 3 --- .../com/exasol/adapter/dialects/snowflake/TestConfig.java | 4 ++++ 5 files changed, 10 insertions(+), 11 deletions(-) create mode 100644 src/test/java/com/exasol/adapter/dialects/snowflake/TestConfig.java diff --git a/.gitattributes b/.gitattributes index 94e0086..99f7c54 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6,8 +6,6 @@ doc/changes/changelog.md linguist-genera .github/workflows/ci-build-next-java.yml linguist-generated=true .github/workflows/dependencies_check.yml linguist-generated=true .github/workflows/dependencies_update.yml linguist-generated=true -.github/workflows/release_droid_print_quick_checksum.yml linguist-generated=true -.github/workflows/release_droid_upload_github_release_assets.yml linguist-generated=true -.github/workflows/release_droid_prepare_original_checksum.yml linguist-generated=true +.github/workflows/release.yml linguist-generated=true .settings/org.eclipse.jdt.core.prefs linguist-generated=true .settings/org.eclipse.jdt.ui.prefs linguist-generated=true diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 268fa2b..67fcb95 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -25,12 +25,12 @@ jobs: fail-fast: false matrix: exasol_db_version: [ - 7.1.25, - 8.24.0 + 8.31.0, + 7.1.29 ] env: { - DEFAULT_EXASOL_DB_VERSION: 7.1.25 + DEFAULT_EXASOL_DB_VERSION: 8.31.0 } steps: - name: Free Disk Space diff --git a/.project-keeper.yml b/.project-keeper.yml index c2672a3..6a683c0 100644 --- a/.project-keeper.yml +++ b/.project-keeper.yml @@ -11,8 +11,8 @@ build: runnerOs: ubuntu-20.04 freeDiskSpace: false exasolDbVersions: - - "7.1.25" - - "8.24.0" + - "8.31.0" + - "7.1.29" workflows: - name: ci-build.yml stepCustomizations: diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java index fb52f02..617516e 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java @@ -212,7 +212,6 @@ public ExasolContainer> getExasolContainer() { public VirtualSchema createVirtualSchema(final String forSnowflakeSchema, final Map additionalProperties) { - // TODO add localstack support + cleanup final Map properties = new HashMap<>(Map.of("CATALOG_NAME", databaseName, // "SCHEMA_NAME", forSnowflakeSchema)); // properties.putAll(additionalProperties); @@ -234,8 +233,6 @@ public void close() { this.snowflakeStatement.close(); this.snowflakeConnection.close(); this.exasolContainer.stop(); - // TODO add localstack support + cleanup - // this.snowflakeContainer.stop(); } catch (final SQLException exception) { throw new IllegalStateException("Failed to stop test setup.", exception); } diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/TestConfig.java b/src/test/java/com/exasol/adapter/dialects/snowflake/TestConfig.java new file mode 100644 index 0000000..9b116e0 --- /dev/null +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/TestConfig.java @@ -0,0 +1,4 @@ +package com.exasol.adapter.dialects.snowflake; + +public class TestConfig { +} From 65a8aa1edf7a0ed310d21f3fd77f3f8f381c28b2 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Thu, 26 Sep 2024 07:00:25 -0400 Subject: [PATCH 24/57] PR review feedback (2) - Use TestConfig + test.properties file instead of 3 different files for accountname, username & password --- .github/workflows/ci-build.yml | 13 ++--- .github/workflows/release.yml | 15 ++--- .gitignore | 4 +- .project-keeper.yml | 27 ++++----- ...lakeVirtualSchemaIntegrationTestSetup.java | 27 ++------- .../dialects/snowflake/TestConfig.java | 55 ++++++++++++++++++- 6 files changed, 82 insertions(+), 59 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 67fcb95..f29eed1 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -70,14 +70,11 @@ jobs: - name: Configure Snowflake credentials id: configure-snowflake-credentials run: | - echo "$USERNAME" > username.txt - echo "$ACCOUNTNAME" > accountname.txt - echo "$PASSWORD" > password.txt - env: { - USERNAME: '${{ secrets.USERNAME }}', - ACCOUNTNAME: '${{ secrets.ACCOUNTNAME }}', - PASSWORD: '${{ secrets.PASSWORD }}' - } + cat > test.properties < username.txt - echo "$ACCOUNTNAME" > accountname.txt - echo "$PASSWORD" > password.txt - env: { - USERNAME: '${{ secrets.USERNAME }}', - ACCOUNTNAME: '${{ secrets.ACCOUNTNAME }}', - PASSWORD: '${{ secrets.PASSWORD }}' - } + run: |- + cat > test.properties < username.txt - echo "$ACCOUNTNAME" > accountname.txt - echo "$PASSWORD" > password.txt - env: { - USERNAME: '${{ secrets.USERNAME }}', - ACCOUNTNAME: '${{ secrets.ACCOUNTNAME }}', - PASSWORD: '${{ secrets.PASSWORD }}' - } + cat > test.properties < username.txt - echo "$ACCOUNTNAME" > accountname.txt - echo "$PASSWORD" > password.txt - env: { - USERNAME: '${{ secrets.USERNAME }}', - ACCOUNTNAME: '${{ secrets.ACCOUNTNAME }}', - PASSWORD: '${{ secrets.PASSWORD }}' - } \ No newline at end of file + cat > test.properties <> exasolContainer = new ExasolContainer<>( EXASOL_DOCKER_IMAGE_REFERENCE).withRequiredServices(ExasolService.BUCKETFS, ExasolService.UDF) @@ -141,25 +139,10 @@ private Connection getSnowflakeConnection(final String username, final String pa } private void getTestCredentials() throws IOException { - if (!Files.exists(Path.of(USERNAME_FILE))) { - throw new IllegalStateException("Could not find " + USERNAME_FILE - + ". Please create a Snowflake account, get the username and store it in this project in " - + USERNAME_FILE + "."); - } - if (!Files.exists(Path.of(PASSWORD_FILE))) { - throw new IllegalStateException("Could not find " + PASSWORD_FILE - + ". Please create a Snowflake account, get the password and store it in this project in " - + PASSWORD_FILE + "."); - } - if (!Files.exists(Path.of(ACCOUNTNAME_FILE))) { - throw new IllegalStateException("Could not find " + ACCOUNTNAME_FILE - + ". Please create a Snowflake account, get the accountName (part of the specific login url you get when creating the account) and store it in this project in " - + ACCOUNTNAME_FILE + "."); - } - - this.userName = Files.readString(Path.of(USERNAME_FILE)).replace("\n", "").replace("\r", ""); - this.password = Files.readString(Path.of(PASSWORD_FILE)).replace("\n", "").replace("\r", ""); - this.accountName = Files.readString(Path.of(ACCOUNTNAME_FILE)).replace("\n", "").replace("\r", ""); + TestConfig testConfig = TestConfig.read(); + this.userName = testConfig.getSnowflakeUsername(); + this.password = testConfig.getSnowflakePassword(); + this.accountName = testConfig.getSnowflakeAccountname(); } private static void uploadDriverToBucket(final ExasolContainer> container) diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/TestConfig.java b/src/test/java/com/exasol/adapter/dialects/snowflake/TestConfig.java index 9b116e0..d791be5 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/TestConfig.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/TestConfig.java @@ -1,4 +1,57 @@ package com.exasol.adapter.dialects.snowflake; +import java.io.*; +import java.nio.file.*; +import java.util.Properties; +import java.util.logging.Logger; + public class TestConfig { -} + private static final Logger LOGGER = Logger.getLogger(TestConfig.class.getName()); + private static final Path CONFIG_FILE = Paths.get("test.properties").toAbsolutePath(); + private final Properties properties; + + private TestConfig(final Properties properties) { + this.properties = properties; + } + + public static TestConfig read() { + final Path file = CONFIG_FILE; + if (!Files.exists(file)) { + throw new IllegalStateException("Config file " + file + " does not exist."); + } + return new TestConfig(loadProperties(file)); + } + + private static Properties loadProperties(final Path configFile) { + LOGGER.info(() -> "Reading config file " + configFile); + try (InputStream stream = Files.newInputStream(configFile)) { + final Properties props = new Properties(); + props.load(stream); + return props; + } catch (final IOException exception) { + throw new UncheckedIOException("Error reading config file " + configFile, exception); + } + } + + + private String getMandatoryValue(final String param) { + if (!properties.containsKey(param)) { + throw new IllegalStateException( + "Config file " + CONFIG_FILE + " does not contain parameter '" + param + "'"); + } + return this.properties.getProperty(param); + } + + public String getSnowflakeUsername() { + return getMandatoryValue("snowflake.username"); + } + + public String getSnowflakeAccountname() { + return getMandatoryValue("snowflake.accountname"); + } + + public String getSnowflakePassword() { + return getMandatoryValue("snowflake.password"); + } + +} \ No newline at end of file From 4ded1469d3d33c9fe9493cf0c5ed40af8be299c9 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Thu, 26 Sep 2024 07:06:27 -0400 Subject: [PATCH 25/57] change release date --- doc/changes/changes_0.1.0.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/changes/changes_0.1.0.md b/doc/changes/changes_0.1.0.md index 9bd4687..5c28dce 100644 --- a/doc/changes/changes_0.1.0.md +++ b/doc/changes/changes_0.1.0.md @@ -1,4 +1,4 @@ -# Virtual Schema for Snowflake 0.1.0, released 2024-09-25 +# Virtual Schema for Snowflake 0.1.0, released 2024-09-26 Code name: First version of the Snowflake virtual schema @@ -44,16 +44,16 @@ Consider this a first and early-access release. * Added `com.exasol:project-keeper-maven-plugin:4.3.3` * Added `io.github.zlika:reproducible-build-maven-plugin:0.16` * Added `org.apache.maven.plugins:maven-assembly-plugin:3.7.1` -* Added `org.apache.maven.plugins:maven-clean-plugin:2.5` +* Added `org.apache.maven.plugins:maven-clean-plugin:3.2.0` * Added `org.apache.maven.plugins:maven-compiler-plugin:3.13.0` * Added `org.apache.maven.plugins:maven-dependency-plugin:3.6.1` -* Added `org.apache.maven.plugins:maven-deploy-plugin:2.7` +* Added `org.apache.maven.plugins:maven-deploy-plugin:3.1.1` * Added `org.apache.maven.plugins:maven-enforcer-plugin:3.5.0` * Added `org.apache.maven.plugins:maven-failsafe-plugin:3.2.5` -* Added `org.apache.maven.plugins:maven-install-plugin:2.4` +* Added `org.apache.maven.plugins:maven-install-plugin:3.1.1` * Added `org.apache.maven.plugins:maven-jar-plugin:3.4.1` -* Added `org.apache.maven.plugins:maven-resources-plugin:2.6` -* Added `org.apache.maven.plugins:maven-site-plugin:3.3` +* Added `org.apache.maven.plugins:maven-resources-plugin:3.3.1` +* Added `org.apache.maven.plugins:maven-site-plugin:3.12.1` * Added `org.apache.maven.plugins:maven-surefire-plugin:3.2.5` * Added `org.apache.maven.plugins:maven-toolchains-plugin:3.2.0` * Added `org.basepom.maven:duplicate-finder-maven-plugin:2.0.1` @@ -62,4 +62,4 @@ Consider this a first and early-access release. * Added `org.codehaus.mojo:versions-maven-plugin:2.16.2` * Added `org.jacoco:jacoco-maven-plugin:0.8.12` * Added `org.sonarsource.scanner.maven:sonar-maven-plugin:4.0.0.4121` -* Added `org.sonatype.ossindex.maven:ossindex-maven-plugin:3.2.0` \ No newline at end of file +* Added `org.sonatype.ossindex.maven:ossindex-maven-plugin:3.2.0` From f485b525bbe0d835ea7ab47884b522e0add59d95 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Thu, 26 Sep 2024 07:23:09 -0400 Subject: [PATCH 26/57] pk dependency update fix --- doc/changes/changes_0.1.0.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/changes/changes_0.1.0.md b/doc/changes/changes_0.1.0.md index 5c28dce..3370dcb 100644 --- a/doc/changes/changes_0.1.0.md +++ b/doc/changes/changes_0.1.0.md @@ -44,16 +44,16 @@ Consider this a first and early-access release. * Added `com.exasol:project-keeper-maven-plugin:4.3.3` * Added `io.github.zlika:reproducible-build-maven-plugin:0.16` * Added `org.apache.maven.plugins:maven-assembly-plugin:3.7.1` -* Added `org.apache.maven.plugins:maven-clean-plugin:3.2.0` +* Added `org.apache.maven.plugins:maven-clean-plugin:2.5` * Added `org.apache.maven.plugins:maven-compiler-plugin:3.13.0` * Added `org.apache.maven.plugins:maven-dependency-plugin:3.6.1` -* Added `org.apache.maven.plugins:maven-deploy-plugin:3.1.1` +* Added `org.apache.maven.plugins:maven-deploy-plugin:2.7` * Added `org.apache.maven.plugins:maven-enforcer-plugin:3.5.0` * Added `org.apache.maven.plugins:maven-failsafe-plugin:3.2.5` -* Added `org.apache.maven.plugins:maven-install-plugin:3.1.1` +* Added `org.apache.maven.plugins:maven-install-plugin:2.4` * Added `org.apache.maven.plugins:maven-jar-plugin:3.4.1` -* Added `org.apache.maven.plugins:maven-resources-plugin:3.3.1` -* Added `org.apache.maven.plugins:maven-site-plugin:3.12.1` +* Added `org.apache.maven.plugins:maven-resources-plugin:2.6` +* Added `org.apache.maven.plugins:maven-site-plugin:3.3` * Added `org.apache.maven.plugins:maven-surefire-plugin:3.2.5` * Added `org.apache.maven.plugins:maven-toolchains-plugin:3.2.0` * Added `org.basepom.maven:duplicate-finder-maven-plugin:2.0.1` @@ -62,4 +62,4 @@ Consider this a first and early-access release. * Added `org.codehaus.mojo:versions-maven-plugin:2.16.2` * Added `org.jacoco:jacoco-maven-plugin:0.8.12` * Added `org.sonarsource.scanner.maven:sonar-maven-plugin:4.0.0.4121` -* Added `org.sonatype.ossindex.maven:ossindex-maven-plugin:3.2.0` +* Added `org.sonatype.ossindex.maven:ossindex-maven-plugin:3.2.0 From ec29ed682b5470007fef7cec97a728d826f8b4d7 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Thu, 26 Sep 2024 07:29:50 -0400 Subject: [PATCH 27/57] fix changes file --- doc/changes/changes_0.1.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changes/changes_0.1.0.md b/doc/changes/changes_0.1.0.md index 3370dcb..6f7edd4 100644 --- a/doc/changes/changes_0.1.0.md +++ b/doc/changes/changes_0.1.0.md @@ -62,4 +62,4 @@ Consider this a first and early-access release. * Added `org.codehaus.mojo:versions-maven-plugin:2.16.2` * Added `org.jacoco:jacoco-maven-plugin:0.8.12` * Added `org.sonarsource.scanner.maven:sonar-maven-plugin:4.0.0.4121` -* Added `org.sonatype.ossindex.maven:ossindex-maven-plugin:3.2.0 +* Added `org.sonatype.ossindex.maven:ossindex-maven-plugin:3.2.0` \ No newline at end of file From efc6290bd08ecd0f4d42bfc02dc70b61f2f9dd2f Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Thu, 26 Sep 2024 10:07:11 -0400 Subject: [PATCH 28/57] update testcontainers to also work with testcontainer versions > 8.29.0 (fix nullpointer exception) --- doc/changes/changes_0.1.0.md | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/changes/changes_0.1.0.md b/doc/changes/changes_0.1.0.md index 6f7edd4..81ef55e 100644 --- a/doc/changes/changes_0.1.0.md +++ b/doc/changes/changes_0.1.0.md @@ -23,7 +23,7 @@ Consider this a first and early-access release. ### Test Dependency Updates * Added `com.exasol:autogenerated-resource-verifier-java:0.1.2` -* Added `com.exasol:exasol-testcontainers:7.0.1` +* Added `com.exasol:exasol-testcontainers:7.1.1` * Added `com.exasol:hamcrest-resultset-matcher:1.6.4` * Added `com.exasol:test-db-builder-java:3.5.3` * Added `com.exasol:udf-debugging-java:0.6.11` diff --git a/pom.xml b/pom.xml index e32d619..ac76a10 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ com.exasol exasol-testcontainers - 7.0.1 + 7.1.1 test From ffd37f74d05a2503c7bb99b95b14ffb9fe654b31 Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Fri, 27 Sep 2024 06:24:18 +0200 Subject: [PATCH 29/57] Fix compile error --- pom.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pom.xml b/pom.xml index ac76a10..25478e1 100644 --- a/pom.xml +++ b/pom.xml @@ -110,6 +110,16 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + + -Xlint:all,-path + -Werror + + + org.apache.maven.plugins maven-assembly-plugin From 6767697065178d0832c023a998d7caf872f39263 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Fri, 27 Sep 2024 03:22:05 -0400 Subject: [PATCH 30/57] cleanup code smells after testconfig refactor --- .../snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java index dd86f8b..9d73038 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java @@ -3,7 +3,6 @@ import static com.exasol.dbbuilder.dialects.exasol.AdapterScript.Language.JAVA; import java.io.*; -import java.nio.file.Files; import java.nio.file.Path; import java.sql.*; import java.util.*; @@ -18,7 +17,6 @@ import com.exasol.errorreporting.ExaError; import com.exasol.udfdebugging.UdfTestSetup; import com.github.dockerjava.api.model.ContainerNetwork; -import org.junit.jupiter.api.Test; /** * This class contains the common integration test setup for all Snowflake virtual schemas. @@ -138,7 +136,7 @@ private Connection getSnowflakeConnection(final String username, final String pa return DriverManager.getConnection(connectStr, properties); } - private void getTestCredentials() throws IOException { + private void getTestCredentials() { TestConfig testConfig = TestConfig.read(); this.userName = testConfig.getSnowflakeUsername(); this.password = testConfig.getSnowflakePassword(); From 3d0230a6752674f9ab28d776ee23d9784d37ad8e Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Fri, 27 Sep 2024 03:22:34 -0400 Subject: [PATCH 31/57] release date --- doc/changes/changes_0.1.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changes/changes_0.1.0.md b/doc/changes/changes_0.1.0.md index 81ef55e..84197c5 100644 --- a/doc/changes/changes_0.1.0.md +++ b/doc/changes/changes_0.1.0.md @@ -1,4 +1,4 @@ -# Virtual Schema for Snowflake 0.1.0, released 2024-09-26 +# Virtual Schema for Snowflake 0.1.0, released 2024-09-27 Code name: First version of the Snowflake virtual schema From a1541c1f1ef8e908b95cf772b892018c58b836f8 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Fri, 27 Sep 2024 03:27:16 -0400 Subject: [PATCH 32/57] fix compilation error after refactoring --- ...SnowflakeVirtualSchemaIntegrationTestSetup.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java index 9d73038..6c22a2b 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java @@ -2,7 +2,8 @@ import static com.exasol.dbbuilder.dialects.exasol.AdapterScript.Language.JAVA; -import java.io.*; +import java.io.Closeable; +import java.io.FileNotFoundException; import java.nio.file.Path; import java.sql.*; import java.util.*; @@ -92,13 +93,11 @@ public String getDatabaseName() { } catch (final InterruptedException exception) { Thread.currentThread().interrupt(); throw new IllegalStateException("Thread was interrupted"); - } catch (final IOException e) { - throw new RuntimeException(e); } } private ConnectionDefinition getSnowflakeConnectionDefinition(final String connectionString, final String username, - final String password) { + final String password) { final ConnectionDefinition connectionDefinition; connectionDefinition = this.exasolFactory.createConnectionDefinition("SNOWFLAKE_CONNECTION", connectionString, username, password); @@ -131,13 +130,14 @@ private Connection getSnowflakeConnection(final String username, final String pa String connectStr = System.getenv("SF_JDBC_CONNECT_STRING"); // use the default connection string if it is not set in environment if (connectStr == null) { - connectStr = "jdbc:snowflake://" + accountname + ".snowflakecomputing.com"; // replace accountName with your account name + connectStr = "jdbc:snowflake://" + accountname + ".snowflakecomputing.com"; // replace accountName with your + // account name } return DriverManager.getConnection(connectStr, properties); } private void getTestCredentials() { - TestConfig testConfig = TestConfig.read(); + final TestConfig testConfig = TestConfig.read(); this.userName = testConfig.getSnowflakeUsername(); this.password = testConfig.getSnowflakePassword(); this.accountName = testConfig.getSnowflakeAccountname(); @@ -192,7 +192,7 @@ public ExasolContainer> getExasolContainer() { } public VirtualSchema createVirtualSchema(final String forSnowflakeSchema, - final Map additionalProperties) { + final Map additionalProperties) { final Map properties = new HashMap<>(Map.of("CATALOG_NAME", databaseName, // "SCHEMA_NAME", forSnowflakeSchema)); // properties.putAll(additionalProperties); From 9b0eff17efb62b2ce8a328b120909823161f18df Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Fri, 27 Sep 2024 05:38:54 -0400 Subject: [PATCH 33/57] reformatted SnowflakeSqlGenerationVisitor --- .../SnowflakeSqlGenerationVisitor.java | 138 +++++++++--------- 1 file changed, 68 insertions(+), 70 deletions(-) diff --git a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitor.java b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitor.java index 9f45ccd..68b084f 100644 --- a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitor.java +++ b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitor.java @@ -57,12 +57,12 @@ private String getColumnProjectionString(final SqlColumn column, final String pr final ColumnAdapterNotesJsonConverter converter = ColumnAdapterNotesJsonConverter.getInstance(); ColumnMetadata metaData = column.getMetadata(); DataType mappedType = metaData.getType(); - ColumnAdapterNotes columnAdapterNotes= converter.convertFromJsonToColumnAdapterNotes(metaData.getAdapterNotes(), column.getName()); - String sourceTypeName = columnAdapterNotes.getTypeName(); + ColumnAdapterNotes columnAdapterNotes = converter.convertFromJsonToColumnAdapterNotes(metaData.getAdapterNotes(), column.getName()); + String sourceTypeName = columnAdapterNotes.getTypeName(); - return buildColumnProjectionString(sourceTypeName,mappedType, projectionString); // + return buildColumnProjectionString(sourceTypeName, mappedType, projectionString); // } else { - return projectionString; + return projectionString; } } @@ -75,33 +75,33 @@ public String visit(final SqlFunctionScalar function) throws AdapterException { } final ScalarFunction scalarFunction = function.getFunction(); switch (scalarFunction) { - case ADD_DAYS: - return getAddDateTime(argumentsSql, "days"); - case ADD_HOURS: - return getAddDateTime(argumentsSql, "hours"); - case ADD_MINUTES: - return getAddDateTime(argumentsSql, "mins"); - case ADD_SECONDS: - return getAddDateTime(argumentsSql, "secs"); - case ADD_WEEKS: - return getAddDateTime(argumentsSql, "weeks"); - case ADD_YEARS: - return getAddDateTime(argumentsSql, "years"); - case ADD_MONTHS: - return getAddDateTime(argumentsSql, "months"); - case SECOND: - case MINUTE: - case DAY: - case WEEK: - case MONTH: - case YEAR: - return getDateTime(argumentsSql, scalarFunction); - case POSIX_TIME: - return getPosixTime(argumentsSql); - case FLOAT_DIV: - return getCastToDoublePrecisionAndDivide(argumentsSql); - default: - return super.visit(function); + case ADD_DAYS: + return getAddDateTime(argumentsSql, "days"); + case ADD_HOURS: + return getAddDateTime(argumentsSql, "hours"); + case ADD_MINUTES: + return getAddDateTime(argumentsSql, "mins"); + case ADD_SECONDS: + return getAddDateTime(argumentsSql, "secs"); + case ADD_WEEKS: + return getAddDateTime(argumentsSql, "weeks"); + case ADD_YEARS: + return getAddDateTime(argumentsSql, "years"); + case ADD_MONTHS: + return getAddDateTime(argumentsSql, "months"); + case SECOND: + case MINUTE: + case DAY: + case WEEK: + case MONTH: + case YEAR: + return getDateTime(argumentsSql, scalarFunction); + case POSIX_TIME: + return getPosixTime(argumentsSql); + case FLOAT_DIV: + return getCastToDoublePrecisionAndDivide(argumentsSql); + default: + return super.visit(function); } } @@ -136,43 +136,43 @@ private String getDateTime(final List argumentsSql, final ScalarFunction private static void appendDatePart(ScalarFunction scalarFunction, StringBuilder builder) { switch (scalarFunction) { - case SECOND: - builder.append("'SECOND'"); - break; - case MINUTE: - builder.append("'MINUTE'"); - break; - case DAY: - builder.append("'DAY'"); - break; - case WEEK: - builder.append("'WEEK'"); - break; - case MONTH: - builder.append("'MONTH'"); - break; - case YEAR: - builder.append("'YEAR'"); - break; - default: - break; + case SECOND: + builder.append("'SECOND'"); + break; + case MINUTE: + builder.append("'MINUTE'"); + break; + case DAY: + builder.append("'DAY'"); + break; + case WEEK: + builder.append("'WEEK'"); + break; + case MONTH: + builder.append("'MONTH'"); + break; + case YEAR: + builder.append("'YEAR'"); + break; + default: + break; } } private static void appendDecimalSize(ScalarFunction scalarFunction, StringBuilder builder) { switch (scalarFunction) { - case SECOND: - case MINUTE: - case DAY: - case WEEK: - case MONTH: - builder.append("2"); - break; - case YEAR: - builder.append("4"); - break; - default: - break; + case SECOND: + case MINUTE: + case DAY: + case WEEK: + case MONTH: + builder.append("2"); + break; + case YEAR: + builder.append("4"); + break; + default: + break; } } @@ -180,14 +180,12 @@ private String getPosixTime(final List argumentsSql) { return "EXTRACT(EPOCH FROM " + argumentsSql.get(0) + ")"; } - private String buildColumnProjectionString(final String typeName,DataType mappedType, final String projectionString) { - if (typeName.startsWith("NUMBER") && mappedType.getExaDataType() == DataType.ExaDataType.VARCHAR ){ + private String buildColumnProjectionString(final String typeName, DataType mappedType, final String projectionString) { + if (typeName.startsWith("NUMBER") && mappedType.getExaDataType() == DataType.ExaDataType.VARCHAR) { return "'Number precision not supported'"; - } - else if (typeName.startsWith("TIMESTAMPTZ")) { - return "TO_TIMESTAMP_NTZ(" + projectionString +")"; - } - else if (checkIfNeedToCastToVarchar(typeName)) { + } else if (typeName.startsWith("TIMESTAMPTZ")) { + return "TO_TIMESTAMP_NTZ(" + projectionString + ")"; + } else if (checkIfNeedToCastToVarchar(typeName)) { return "CAST(" + projectionString + " as VARCHAR )"; } else if (typeName.startsWith("smallserial")) { return "CAST(" + projectionString + " as SMALLINT )"; From bf90929ed2018b91b2b249f2d63a690c459ce2ab Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Fri, 27 Sep 2024 05:39:53 -0400 Subject: [PATCH 34/57] set docker image reference in integration test setup to latest dockerdb version --- .../snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java index 6c22a2b..93d687a 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java @@ -27,7 +27,7 @@ public class SnowflakeVirtualSchemaIntegrationTestSetup implements Closeable { private static final Path PATH_TO_VIRTUAL_SCHEMAS_JAR = Path.of("target", VIRTUAL_SCHEMAS_JAR_NAME_AND_VERSION); private static final String SCHEMA_EXASOL = "SCHEMA_EXASOL"; private static final String ADAPTER_SCRIPT_EXASOL = "ADAPTER_SCRIPT_EXASOL"; - private static final String EXASOL_DOCKER_IMAGE_REFERENCE = "8.24.0"; + private static final String EXASOL_DOCKER_IMAGE_REFERENCE = "8.31.0"; private static final String SNOWFLAKE_CONTAINER_NAME = "localstack/snowflake:14.2"; private static final String JDBC_DRIVER_NAME = "snowflake-jdbc.jar"; From 5f127d3fa0815defa32599e2ae208bd5de67ee6c Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Fri, 27 Sep 2024 05:41:39 -0400 Subject: [PATCH 35/57] removed unused dependency + moved dependency to integration test dependency block --- pom.xml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index 25478e1..8833b42 100644 --- a/pom.xml +++ b/pom.xml @@ -27,13 +27,6 @@ 3.16.1 - - com.exasol - virtual-schema-common-jdbc - ${vscjdbc.version} - test-jar - test - org.hamcrest hamcrest @@ -53,6 +46,13 @@ test + + com.exasol + virtual-schema-common-jdbc + ${vscjdbc.version} + test-jar + test + com.exasol exasol-testcontainers @@ -65,12 +65,6 @@ ${org.testcontainers.version} test - - org.testcontainers - localstack - 1.19.8 - test - com.exasol test-db-builder-java From 316fee97b48cb92d4dbef3b0f29bfa45637a1f03 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Fri, 27 Sep 2024 07:07:32 -0400 Subject: [PATCH 36/57] cleaned up IntegrationTestSetup class --- ...lakeVirtualSchemaIntegrationTestSetup.java | 31 +++++++------------ 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java index 93d687a..2c1e021 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java @@ -28,12 +28,10 @@ public class SnowflakeVirtualSchemaIntegrationTestSetup implements Closeable { private static final String SCHEMA_EXASOL = "SCHEMA_EXASOL"; private static final String ADAPTER_SCRIPT_EXASOL = "ADAPTER_SCRIPT_EXASOL"; private static final String EXASOL_DOCKER_IMAGE_REFERENCE = "8.31.0"; - private static final String SNOWFLAKE_CONTAINER_NAME = "localstack/snowflake:14.2"; private static final String JDBC_DRIVER_NAME = "snowflake-jdbc.jar"; private static final Path JDBC_DRIVER_PATH = Path.of("target/snowflake-driver/" + JDBC_DRIVER_NAME); - private static final int SNOWFLAKE_PORT = 5432; private final Statement snowflakeStatement; private final ExasolContainer> exasolContainer = new ExasolContainer<>( EXASOL_DOCKER_IMAGE_REFERENCE).withRequiredServices(ExasolService.BUCKETFS, ExasolService.UDF) @@ -56,10 +54,10 @@ public String randomDbAddendum() { final int targetStringLength = 4; final Random random = new Random(); - final String generatedString = random.ints(leftLimit, rightLimit + 1).limit(targetStringLength) + return random.ints(leftLimit, rightLimit + 1).limit(targetStringLength) .collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append).toString(); - return generatedString; + } public String getDatabaseName() { @@ -97,7 +95,7 @@ public String getDatabaseName() { } private ConnectionDefinition getSnowflakeConnectionDefinition(final String connectionString, final String username, - final String password) { + final String password) { final ConnectionDefinition connectionDefinition; connectionDefinition = this.exasolFactory.createConnectionDefinition("SNOWFLAKE_CONNECTION", connectionString, username, password); @@ -119,20 +117,13 @@ private Connection getSnowflakeConnection(final String username, final String pa // build connection properties final Properties properties = new Properties(); - properties.put("user", username); // replace "" with your username - properties.put("password", password); // replace "" with your password - properties.put("account", accountname); // replace "" with your account name - properties.put("db", this.databaseName); // replace "" with target database name - properties.put("schema", "TESTSCHEMA"); // replace "" with target schema name - // properties.put("tracing", "on"); - - // create a new connection - String connectStr = System.getenv("SF_JDBC_CONNECT_STRING"); - // use the default connection string if it is not set in environment - if (connectStr == null) { - connectStr = "jdbc:snowflake://" + accountname + ".snowflakecomputing.com"; // replace accountName with your - // account name - } + properties.put("user", username); + properties.put("password", password); + properties.put("account", accountname); + properties.put("db", this.databaseName); + properties.put("schema", "TESTSCHEMA"); + + String connectStr = "jdbc:snowflake://" + accountname + ".snowflakecomputing.com"; // replace accountName with your account name return DriverManager.getConnection(connectStr, properties); } @@ -192,7 +183,7 @@ public ExasolContainer> getExasolContainer() { } public VirtualSchema createVirtualSchema(final String forSnowflakeSchema, - final Map additionalProperties) { + final Map additionalProperties) { final Map properties = new HashMap<>(Map.of("CATALOG_NAME", databaseName, // "SCHEMA_NAME", forSnowflakeSchema)); // properties.putAll(additionalProperties); From 1a82a38499b09683c2da8af8d426c94f61e04a38 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Fri, 27 Sep 2024 07:07:59 -0400 Subject: [PATCH 37/57] removed // --- .../dialects/snowflake/SnowflakeSqlGenerationVisitor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitor.java b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitor.java index 68b084f..4efc0b8 100644 --- a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitor.java +++ b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitor.java @@ -60,7 +60,7 @@ private String getColumnProjectionString(final SqlColumn column, final String pr ColumnAdapterNotes columnAdapterNotes = converter.convertFromJsonToColumnAdapterNotes(metaData.getAdapterNotes(), column.getName()); String sourceTypeName = columnAdapterNotes.getTypeName(); - return buildColumnProjectionString(sourceTypeName, mappedType, projectionString); // + return buildColumnProjectionString(sourceTypeName, mappedType, projectionString); } else { return projectionString; } From 19adae7fa4bb2f742ccb8fe7710ad8c7ee77cb80 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Fri, 27 Sep 2024 08:55:56 -0400 Subject: [PATCH 38/57] simplified snowflake database setup and teardown in IT class --- .../snowflake/SnowflakeSqlDialectIT.java | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectIT.java b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectIT.java index 9507be4..028d55b 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectIT.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectIT.java @@ -44,19 +44,11 @@ class SnowflakeSqlDialectIT { @BeforeAll static void beforeAll() throws SQLException { final Statement statementSnowflake = SETUP.getSnowflakeStatement(); - try { - statementSnowflake.execute("CREATE DATABASE " + SETUP.getDatabaseName()); - } catch (final Exception e) { - } - try { - statementSnowflake.execute("DROP SCHEMA " + SCHEMA_SNOWFLAKE + " CASCADE"); - statementSnowflake.execute("DROP SCHEMA " + SCHEMA_SNOWFLAKE_UPPERCASE_TABLE + " CASCADE"); - } catch (final Exception e) { - - } + statementSnowflake.execute("CREATE DATABASE " + SETUP.getDatabaseName()); statementSnowflake.execute("CREATE SCHEMA " + SCHEMA_SNOWFLAKE); statementSnowflake.execute("CREATE SCHEMA " + SCHEMA_SNOWFLAKE_UPPERCASE_TABLE); + createSnowflakeTestTableSimple(statementSnowflake); createSnowflakeTestTableAllDataTypes(statementSnowflake); createTestTablesForJoinTests(SCHEMA_SNOWFLAKE); @@ -71,11 +63,7 @@ static void beforeAll() throws SQLException { @AfterAll static void afterAll() throws SQLException { final Statement statementSnowflake = SETUP.getSnowflakeStatement(); - try { statementSnowflake.execute("DROP DATABASE " + SETUP.getDatabaseName() + " CASCADE;"); - } catch (final Exception e) { - - } } private static void createSnowflakeTestTableSimple(final Statement statementSnowflake) throws SQLException { From 05c43fa0b32aec34fe3ca1d421d395542e2d55e6 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Fri, 27 Sep 2024 08:56:33 -0400 Subject: [PATCH 39/57] PR Review: requested changes to user guide --- doc/user_guide/snowflake_user_guide.md | 105 ++++++++++++------------- 1 file changed, 52 insertions(+), 53 deletions(-) diff --git a/doc/user_guide/snowflake_user_guide.md b/doc/user_guide/snowflake_user_guide.md index 1ce757d..fb1f441 100644 --- a/doc/user_guide/snowflake_user_guide.md +++ b/doc/user_guide/snowflake_user_guide.md @@ -27,7 +27,7 @@ INSERTSIZE=-1 NOSECURITY=YES ``` -Make sure there's a newline at the end of the `settings.cfg` file, as shown above, or it will not be properly read out, the EXALoader will display an error message. +Make sure there's an empty line at the end of the `settings.cfg` file, as shown above, or it will not be properly read out, the EXALoader will display an error message. | Variable | Description | |-----------------------------------------|----------------------------------| @@ -56,7 +56,7 @@ CREATE OR REPLACE JAVA ADAPTER SCRIPT ADAPTER.SNOWFLAKE_JDBC_ADAPTER AS ## Defining a Named Connection -Define the connection to the Snowflake database as shown below. We recommend using TLS to secure the connection. +Define the connection to the Snowflake database as shown below. ```sql CREATE OR REPLACE CONNECTION SNOWFLAKE_CONNECTION @@ -65,9 +65,8 @@ USER '' IDENTIFIED BY ''; ``` -| Variable | Description | -|----------|-------------| - +| Variable | Description | +|-----------------|-------------------------------------------------------------------------| | ` CONNECTION_NAME = 'SNOWFLAKE_CONNECTION'; ``` -| Variable | Description | -|-------------------------|-----------------------------------------------------------------------------------------------------| -| `` | Name of the virtual schema you want to use. | -| `` | Name of the catalog, usally equivalent to the name of the Snowflake database. Please use UPPERCASE. | -| `` | Name of the database schema you want to use in the Snowflake database. Please use UPPERCASE. | +| Variable | Description | +|-------------------------|------------------------------------------------------------------------------------------------------| +| `` | Name of the virtual schema you want to use. | +| `` | Name of the catalog, usually equivalent to the name of the Snowflake database. Please use UPPERCASE. | +| `` | Name of the database schema you want to use in the Snowflake database. Please use UPPERCASE. | -For additional parameters coming from the base library see also [Adapter Properties for JDBC-Based Virtual Schemas](https://github.com/exasol/virtual-schema-common-jdbc#adapter-properties-for-jdbc-based-virtual-schemas). +For additional parameters (optional), see also [Adapter Properties for JDBC-Based Virtual Schemas](https://github.com/exasol/virtual-schema-common-jdbc#adapter-properties-for-jdbc-based-virtual-schemas). ## Data Types Conversion -| Snowflake Data Type | Supported | Converted Exasol Data Type | Known limitations | -|--------------------------|--------------|----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------| -| BIGINT | ✓ | DECIMAL(19,0) | | -| BIGSERIAL | ✓ | DECIMAL(19,0) | | -| BIT | ✓ | BOOLEAN | | -| BIT VARYING | ✓ | VARCHAR(5) | | -| BOX | ✓ | VARCHAR(2000000) | | -| BYTEA | ✓ | VARCHAR(2000000) | | -| BOOLEAN | ✓ | BOOLEAN | | -| CHARACTER | ✓ | CHAR | | -| CHARACTER VARYING | ✓ | VARCHAR | | -| CIDR | ✓ | VARCHAR(2000000) | | -| CIRCLE | ✓ | VARCHAR(2000000) | | -| DATE | ✓ | DATE | | -| DOUBLE PRECISION | ✓ | DOUBLE | | -| INET | ✓ | VARCHAR(2000000) | | -| INTEGER | ✓ | DECIMAL(10,0) | | -| INTERVAL | ✓ | VARCHAR(2000000) | | -| JSON | ✓ | VARCHAR(2000000) | | -| JSONB | ✓ | VARCHAR(2000000) | | -| LINE | ✓ | VARCHAR(2000000) | | -| LSEG | ✓ | VARCHAR(2000000) | | -| MACADDR | ✓ | VARCHAR(2000000) | | -| MONEY | ✓ | DOUBLE | | -| NUMERIC | ✓ | VARCHAR(2000000) | Stored in Exasol as VARCHAR, because Snowflake NUMERIC values can exceed Exasol Decimal limit which makes it impossible to use Virtual Schemas. | -| PATH | ✓ | VARCHAR(2000000) | | -| POINT | ✓ | VARCHAR(2000000) | | -| POLYGON | ✓ | VARCHAR(2000000) | | -| REAL | ✓ | DOUBLE | | -| SMALLINT | ✓ | DECIMAL(5,0) | | -| SMALLSERIAL | ? (untested) | | | -| SERIAL | ? (untested) | | | -| TEXT | ✓ | VARCHAR(2000000) | | -| TIME | ✓ | VARCHAR(2000000) | | -| TIME WITH TIME ZONE | ✓ | VARCHAR(2000000) | | -| TIMESTAMP | ✓ | TIMESTAMP | | -| TIMESTAMP WITH TIME ZONE | ✓ | TIMESTAMP | | -| TSQUERY | ✓ | VARCHAR(2000000) | | -| TSVECTOR | ✓ | VARCHAR(2000000) | | -| UUID | ✓ | VARCHAR(2000000) | | -| XML | ✓ | VARCHAR(2000000) | | +| Snowflake Data Type | Supported | Converted Exasol Data Type | Known limitations | +|--------------------------|---------------|----------------------------|---------------------------------------------------------------------------------------------------------------------| +| BIGINT | ✓ | VARCHAR(2000000) | Alias for NUMBER(38,0) in Snowflake | +| BIGSERIAL | ✓ | DECIMAL(19,0) | | +| BIT | ✓ | BOOLEAN | | +| BIT VARYING | ✓ | VARCHAR(5) | | +| BOX | ✓ | VARCHAR(2000000) | | +| BYTEA | ✓ | VARCHAR(2000000) | | +| BOOLEAN | ✓ | BOOLEAN | | +| CHARACTER | ✓ | VARCHAR | | +| CHARACTER VARYING | ✓ | VARCHAR | | +| CIDR | ✓ | VARCHAR(2000000) | | +| CIRCLE | ✓ | VARCHAR(2000000) | | +| DATE | ✓ | DATE | | +| DOUBLE PRECISION | ✓ | DOUBLE | | +| INET | ✓ | VARCHAR(2000000) | | +| INTEGER | ✓ | DECIMAL(10,0) | | +| INTERVAL | ✓ | VARCHAR(2000000) | | +| JSON | ✓ | VARCHAR(2000000) | | +| JSONB | ✓ | VARCHAR(2000000) | | +| LINE | ✓ | VARCHAR(2000000) | | +| LSEG | ✓ | VARCHAR(2000000) | | +| MACADDR | ✓ | VARCHAR(2000000) | | +| MONEY | ✓ | DOUBLE | | +| NUMERIC | ✓ | DECIMAL/VARCHAR(2000000) | Stored in Exasol as DECIMAL or VARCHAR, because Snowflake NUMERIC values can exceed Exasol NUMERIC PRECISION limit. | +| PATH | ✓ | VARCHAR(2000000) | | +| POINT | ✓ | VARCHAR(2000000) | | +| POLYGON | ✓ | VARCHAR(2000000) | | +| REAL | ✓ | DOUBLE | | +| SMALLINT | ✓ | VARCHAR(2000000) | Alias for NUMBER(38,0) | +| SMALLSERIAL | (unsupported) | | | +| SERIAL | (unsupported) | | | +| TEXT | ✓ | VARCHAR(2000000) | | +| TIME | ✓ | TIME | | +| TIME WITH TIME ZONE | ✓ | VARCHAR(2000000) | | +| TIMESTAMP | ✓ | TIMESTAMP | | +| TIMESTAMP WITH TIME ZONE | ✓ | TIMESTAMP (UTC) | | +| TSQUERY | ✓ | VARCHAR(2000000) | | +| TSVECTOR | ✓ | VARCHAR(2000000) | | +| UUID | ✓ | VARCHAR(2000000) | | +| XML | ✓ | VARCHAR(2000000) | | From fb01a6b9f620a625a3fa3ec474486812bc8f2d8f Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Mon, 30 Sep 2024 03:58:30 -0400 Subject: [PATCH 40/57] removed 'serial' cases in visitor since these don't exist in snowflake --- .../dialects/snowflake/SnowflakeSqlGenerationVisitor.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitor.java b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitor.java index 4efc0b8..397a4f7 100644 --- a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitor.java +++ b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitor.java @@ -187,12 +187,6 @@ private String buildColumnProjectionString(final String typeName, DataType mappe return "TO_TIMESTAMP_NTZ(" + projectionString + ")"; } else if (checkIfNeedToCastToVarchar(typeName)) { return "CAST(" + projectionString + " as VARCHAR )"; - } else if (typeName.startsWith("smallserial")) { - return "CAST(" + projectionString + " as SMALLINT )"; - } else if (typeName.startsWith("serial")) { - return "CAST(" + projectionString + " as INTEGER )"; - } else if (typeName.startsWith("bigserial")) { - return "CAST(" + projectionString + " as BIGINT )"; } else if (TYPE_NAMES_NOT_SUPPORTED.contains(typeName)) { return "cast('" + typeName + " NOT SUPPORTED' as varchar) as not_supported"; } else { From d741c7cf754b9abad7db9f8729b3a1bf24c9051c Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Mon, 30 Sep 2024 03:59:55 -0400 Subject: [PATCH 41/57] fix formatting --- .../SnowflakeColumnMetadataReader.java | 24 +++++++++---------- .../snowflake/SnowflakeMetadataReader.java | 2 +- .../snowflake/SnowflakeSqlDialectFactory.java | 4 ++-- .../SnowflakeTableMetadataReader.java | 2 +- .../SnowflakeColumnMetadataReaderTest.java | 3 +-- .../snowflake/SnowflakeSqlDialectIT.java | 2 +- .../snowflake/SnowflakeSqlDialectTest.java | 4 ++-- .../SnowflakeSqlGenerationVisitorTest.java | 12 +++++----- .../docgeneration/CapabilitiesReport.java | 2 +- .../exasol/closeafterall/CloseAfterAll.java | 2 +- .../closeafterall/CloseAfterAllExtension.java | 2 +- 11 files changed, 29 insertions(+), 30 deletions(-) diff --git a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReader.java b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReader.java index f2f9ae2..ed1bc7f 100644 --- a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReader.java +++ b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReader.java @@ -24,7 +24,7 @@ public class SnowflakeColumnMetadataReader extends BaseColumnMetadataReader { * @param identifierConverter converter between source and Exasol identifiers */ public SnowflakeColumnMetadataReader(final Connection connection, final AdapterProperties properties, - final IdentifierConverter identifierConverter) { + final IdentifierConverter identifierConverter) { super(connection, properties, identifierConverter); } @@ -36,16 +36,16 @@ public SnowflakeColumnMetadataReader(final Connection connection, final AdapterP @Override public DataType mapJdbcType(final JDBCTypeDescription jdbcTypeDescription) { switch (jdbcTypeDescription.getJdbcType()) { - case Types.OTHER: - return mapJdbcTypeOther(jdbcTypeDescription); - case Types.SQLXML: - case Types.DISTINCT: - case Types.BINARY: - return DataType.createMaximumSizeVarChar(DataType.ExaCharset.UTF8); - case Types.TIMESTAMP_WITH_TIMEZONE: - return DataType.createTimestamp(false); - default: - return super.mapJdbcType(jdbcTypeDescription); + case Types.OTHER: + return mapJdbcTypeOther(jdbcTypeDescription); + case Types.SQLXML: + case Types.DISTINCT: + case Types.BINARY: + return DataType.createMaximumSizeVarChar(DataType.ExaCharset.UTF8); + case Types.TIMESTAMP_WITH_TIMEZONE: + return DataType.createTimestamp(false); + default: + return super.mapJdbcType(jdbcTypeDescription); } } @@ -67,7 +67,7 @@ protected boolean isVarBitColumn(final JDBCTypeDescription jdbcTypeDescription) @Override public String readColumnName(final ResultSet columns) throws SQLException { - return super.readColumnName(columns); + return super.readColumnName(columns); } @Override diff --git a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeMetadataReader.java b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeMetadataReader.java index e323fdd..4f8e6c0 100644 --- a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeMetadataReader.java +++ b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeMetadataReader.java @@ -39,7 +39,7 @@ public ColumnMetadataReader createColumnMetadataReader() { @Override public String getSchemaNameFilter() { - return this.properties.getSchemaName().replace("_","\\_").toUpperCase(); + return this.properties.getSchemaName().replace("_", "\\_").toUpperCase(); } } \ No newline at end of file diff --git a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectFactory.java b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectFactory.java index 1f4db40..7b4aef9 100644 --- a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectFactory.java +++ b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectFactory.java @@ -10,7 +10,7 @@ * Factory for the Snowflake SQL dialect. */ public class SnowflakeSqlDialectFactory implements SqlDialectFactory { - + @Override public String getSqlDialectName() { return SnowflakeSqlDialect.NAME; @@ -20,7 +20,7 @@ public String getSqlDialectName() { public SqlDialect createSqlDialect(final ConnectionFactory connectionFactory, final AdapterProperties properties) { return new SnowflakeSqlDialect(connectionFactory, properties); } - + @Override public String getSqlDialectVersion() { final VersionCollector versionCollector = new VersionCollector( diff --git a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeTableMetadataReader.java b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeTableMetadataReader.java index d7124ac..687403d 100644 --- a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeTableMetadataReader.java +++ b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeTableMetadataReader.java @@ -25,7 +25,7 @@ public class SnowflakeTableMetadataReader extends BaseTableMetadataReader { * @param identifierConverter converter between source and Exasol identifiers */ public SnowflakeTableMetadataReader(final Connection connection, final ColumnMetadataReader columnMetadataReader, - final AdapterProperties properties, final IdentifierConverter identifierConverter) { + final AdapterProperties properties, final IdentifierConverter identifierConverter) { super(connection, columnMetadataReader, properties, identifierConverter); } } \ No newline at end of file diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReaderTest.java b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReaderTest.java index c758103..15cb163 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReaderTest.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReaderTest.java @@ -42,7 +42,7 @@ protected DataType mapJdbcType(final int type) { return this.columnMetadataReader.mapJdbcType(jdbcTypeDescription); } - @ValueSource(ints = { Types.SQLXML, Types.DISTINCT }) + @ValueSource(ints = {Types.SQLXML, Types.DISTINCT}) @ParameterizedTest void testMapJdbcTypeFallbackToMaxVarChar(final int type) { assertThat(mapJdbcType(type), equalTo(DataType.createMaximumSizeVarChar(DataType.ExaCharset.UTF8))); @@ -54,5 +54,4 @@ void testMapJdbcTypeFallbackToParent() { } - } diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectIT.java b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectIT.java index 028d55b..5327f86 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectIT.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectIT.java @@ -63,7 +63,7 @@ static void beforeAll() throws SQLException { @AfterAll static void afterAll() throws SQLException { final Statement statementSnowflake = SETUP.getSnowflakeStatement(); - statementSnowflake.execute("DROP DATABASE " + SETUP.getDatabaseName() + " CASCADE;"); + statementSnowflake.execute("DROP DATABASE " + SETUP.getDatabaseName() + " CASCADE;"); } private static void createSnowflakeTestTableSimple(final Statement statementSnowflake) throws SQLException { diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectTest.java b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectTest.java index f268462..4e55d9d 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectTest.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectTest.java @@ -87,8 +87,8 @@ void testGetCapabilities() { ); } - @ValueSource(strings = { "ab:E'ab'", "a'b:E'a''b'", "a''b:E'a''''b'", "'ab':E'''ab'''", "a\\\\b:E'a\\\\\\\\b'", - "a\\'b:E'a\\\\''b'" }) + @ValueSource(strings = {"ab:E'ab'", "a'b:E'a''b'", "a''b:E'a''''b'", "'ab':E'''ab'''", "a\\\\b:E'a\\\\\\\\b'", + "a\\'b:E'a\\\\''b'"}) @ParameterizedTest void testGetLiteralString(final String definition) { assertThat(this.dialect.getStringLiteral(definition.substring(0, definition.indexOf(':'))), diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitorTest.java b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitorTest.java index 1f9a7e5..e3e6d99 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitorTest.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitorTest.java @@ -38,13 +38,13 @@ void beforeEach(@Mock final ConnectionFactory connectionFactoryMock) { this.visitor = new SnowflakeSqlGenerationVisitor(dialect, context); } - @CsvSource({ "ADD_DAYS, days", // + @CsvSource({"ADD_DAYS, days", // "ADD_HOURS, hours", // "ADD_MINUTES, mins", // "ADD_SECONDS, secs", // "ADD_YEARS, years", // "ADD_WEEKS, weeks", // - "ADD_MONTHS, months" }) + "ADD_MONTHS, months"}) @ParameterizedTest void testVisitSqlFunctionScalarAddDate(final ScalarFunction scalarFunction, final String expected) throws AdapterException { @@ -54,7 +54,7 @@ void testVisitSqlFunctionScalarAddDate(final ScalarFunction scalarFunction, fina } private SqlFunctionScalar createSqlFunctionScalarForDateTest(final ScalarFunction scalarFunction, - final int numericValue) { + final int numericValue) { final List arguments = new ArrayList<>(); arguments.add(new SqlColumn(1, ColumnMetadata.builder().name("test_column") @@ -64,15 +64,15 @@ private SqlFunctionScalar createSqlFunctionScalarForDateTest(final ScalarFunctio return new SqlFunctionScalar(scalarFunction, arguments); } - @CsvSource({ "SECOND, SECOND, 2", // + @CsvSource({"SECOND, SECOND, 2", // "MINUTE, MINUTE, 2", // "DAY, DAY, 2", // "WEEK, WEEK, 2", // "MONTH, MONTH, 2", // - "YEAR, YEAR, 4" }) + "YEAR, YEAR, 4"}) @ParameterizedTest void testVisitSqlFunctionScalarDatetime(final ScalarFunction scalarFunction, final String expected, - final String decimalSize) throws AdapterException { + final String decimalSize) throws AdapterException { final SqlFunctionScalar sqlFunctionScalar = createSqlFunctionScalarForDateTest(scalarFunction, 0); assertThat(this.visitor.visit(sqlFunctionScalar), equalTo("CAST(DATE_PART('" + expected + "',\"test_column\") AS DECIMAL(" + decimalSize + ",0))")); diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/docgeneration/CapabilitiesReport.java b/src/test/java/com/exasol/adapter/dialects/snowflake/docgeneration/CapabilitiesReport.java index a749989..1a03311 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/docgeneration/CapabilitiesReport.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/docgeneration/CapabilitiesReport.java @@ -53,7 +53,7 @@ public Path getPathOfGeneratedFile() { } private void reportCapabilities(final String headline, final String tableHeader, final T[] all, - final Set enabled, final LinedStringBuilder reportBuilder) { + final Set enabled, final LinedStringBuilder reportBuilder) { reportBuilder.appendLine("## " + headline); reportBuilder.appendLine(); final Table.Builder tableBuilder = new Table.Builder().withAlignments(Table.ALIGN_LEFT, Table.ALIGN_CENTER) diff --git a/src/test/java/com/exasol/closeafterall/CloseAfterAll.java b/src/test/java/com/exasol/closeafterall/CloseAfterAll.java index 81d2191..5548f6b 100644 --- a/src/test/java/com/exasol/closeafterall/CloseAfterAll.java +++ b/src/test/java/com/exasol/closeafterall/CloseAfterAll.java @@ -8,7 +8,7 @@ * In order to make this work you need to add the {@link CloseAfterAllExtension} to your test class. *

*/ -@Target({ ElementType.FIELD }) +@Target({ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface CloseAfterAll { } diff --git a/src/test/java/com/exasol/closeafterall/CloseAfterAllExtension.java b/src/test/java/com/exasol/closeafterall/CloseAfterAllExtension.java index 5b2da71..2026ce4 100644 --- a/src/test/java/com/exasol/closeafterall/CloseAfterAllExtension.java +++ b/src/test/java/com/exasol/closeafterall/CloseAfterAllExtension.java @@ -41,7 +41,7 @@ private void closeObject(final Field field, final Object annotatedObject) throws ((Closeable) annotatedObject).close(); } else { throw new IllegalStateException(ExaError.messageBuilder("E-VSSF-9").message( - "Could not close the field {{field}} annotated with @CloseAfterAll since it does not implement Closable.") + "Could not close the field {{field}} annotated with @CloseAfterAll since it does not implement Closable.") .parameter("field", field.getName()).toString()); } } From 8b85fe568ca7ab2eb41448322815c0b98cb40a2d Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Mon, 30 Sep 2024 04:27:28 -0400 Subject: [PATCH 42/57] changes to visibility and logger settings --- .../dialects/snowflake/SnowflakeColumnMetadataReader.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReader.java b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReader.java index ed1bc7f..da65283 100644 --- a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReader.java +++ b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeColumnMetadataReader.java @@ -49,19 +49,19 @@ public DataType mapJdbcType(final JDBCTypeDescription jdbcTypeDescription) { } } - protected DataType mapJdbcTypeOther(final JDBCTypeDescription jdbcTypeDescription) { + private DataType mapJdbcTypeOther(final JDBCTypeDescription jdbcTypeDescription) { if (isVarBitColumn(jdbcTypeDescription)) { final int n = jdbcTypeDescription.getPrecisionOrSize(); - LOGGER.finer(() -> "Mapping Snowflake datatype \"OTHER:varbit\" to VARCHAR(" + n + ")"); + LOGGER.finest(() -> "Mapping Snowflake datatype \"OTHER:varbit\" to VARCHAR(" + n + ")"); return DataType.createVarChar(n, DataType.ExaCharset.UTF8); } else { - LOGGER.finer(() -> "Mapping Snowflake datatype \"" + jdbcTypeDescription.getTypeName() + LOGGER.finest(() -> "Mapping Snowflake datatype \"" + jdbcTypeDescription.getTypeName() + "\" to maximum VARCHAR()"); return DataType.createMaximumSizeVarChar(DataType.ExaCharset.UTF8); } } - protected boolean isVarBitColumn(final JDBCTypeDescription jdbcTypeDescription) { + private boolean isVarBitColumn(final JDBCTypeDescription jdbcTypeDescription) { return jdbcTypeDescription.getTypeName().equals(SNOWFLAKE_VARBIT_TYPE_NAME); } From c68f6a377b72232824f283b83c43fdbab2236834 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Mon, 30 Sep 2024 04:28:13 -0400 Subject: [PATCH 43/57] changes to exception handling --- .../SnowflakeVirtualSchemaIntegrationTestSetup.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java index 2c1e021..64be266 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeVirtualSchemaIntegrationTestSetup.java @@ -86,7 +86,7 @@ public String getDatabaseName() { this.adapterScript = createAdapterScript(exasolSchema); final String connectionString = getSnowflakeConnectionString(accountName); connectionDefinition = getSnowflakeConnectionDefinition(connectionString, userName, password); - } catch (final SQLException | BucketAccessException | TimeoutException exception) { + } catch (final SQLException | BucketAccessException | TimeoutException | ClassNotFoundException exception ) { throw new IllegalStateException("Failed to created snowflake test setup.", exception); } catch (final InterruptedException exception) { Thread.currentThread().interrupt(); @@ -108,13 +108,8 @@ private String getSnowflakeConnectionString(final String accountname) { } private Connection getSnowflakeConnection(final String username, final String password, final String accountname) - throws SQLException { - try { + throws SQLException, ClassNotFoundException { Class.forName("net.snowflake.client.jdbc.SnowflakeDriver"); - } catch (final ClassNotFoundException ex) { - System.err.println("Driver not found"); - } - // build connection properties final Properties properties = new Properties(); properties.put("user", username); From ef3bfbed3699ea9d873de76ef69edecccf8998a2 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Mon, 30 Sep 2024 04:29:53 -0400 Subject: [PATCH 44/57] Removed unnecessary whitespace --- .../adapter/dialects/snowflake/SnowflakeMetadataReader.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeMetadataReader.java b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeMetadataReader.java index 4f8e6c0..3d4386f 100644 --- a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeMetadataReader.java +++ b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeMetadataReader.java @@ -41,5 +41,4 @@ public ColumnMetadataReader createColumnMetadataReader() { public String getSchemaNameFilter() { return this.properties.getSchemaName().replace("_", "\\_").toUpperCase(); } - } \ No newline at end of file From 0b4f9df2cb0f21a20004a3f5e4b0a60fac9dc231 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Mon, 30 Sep 2024 04:30:18 -0400 Subject: [PATCH 45/57] Changed comment as suggested --- .../exasol/adapter/dialects/snowflake/SnowflakeSqlDialect.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialect.java b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialect.java index 312b63c..a428b85 100644 --- a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialect.java +++ b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialect.java @@ -82,7 +82,7 @@ private static Capabilities createCapabilityList() { } /** - * This class gets all {@link ScalarFunctionCapability}s that are not explicitly excluded by + * Return all {@link ScalarFunctionCapability}s that are not explicitly excluded by * {@link #DISABLED_SCALAR_FUNCTION}. * * @return list enabled scalar function capabilities From 25aa6f275f2ecf67d4f26fae3f44a4ef7ae2e98a Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Mon, 30 Sep 2024 08:22:09 -0400 Subject: [PATCH 46/57] user guide, redid conversion/mapping table --- doc/user_guide/snowflake_user_guide.md | 52 ++++++-------------------- 1 file changed, 11 insertions(+), 41 deletions(-) diff --git a/doc/user_guide/snowflake_user_guide.md b/doc/user_guide/snowflake_user_guide.md index fb1f441..1c54651 100644 --- a/doc/user_guide/snowflake_user_guide.md +++ b/doc/user_guide/snowflake_user_guide.md @@ -99,44 +99,14 @@ For additional parameters (optional), see also [Adapter Properties for JDBC-Base ## Data Types Conversion -| Snowflake Data Type | Supported | Converted Exasol Data Type | Known limitations | -|--------------------------|---------------|----------------------------|---------------------------------------------------------------------------------------------------------------------| -| BIGINT | ✓ | VARCHAR(2000000) | Alias for NUMBER(38,0) in Snowflake | -| BIGSERIAL | ✓ | DECIMAL(19,0) | | -| BIT | ✓ | BOOLEAN | | -| BIT VARYING | ✓ | VARCHAR(5) | | -| BOX | ✓ | VARCHAR(2000000) | | -| BYTEA | ✓ | VARCHAR(2000000) | | -| BOOLEAN | ✓ | BOOLEAN | | -| CHARACTER | ✓ | VARCHAR | | -| CHARACTER VARYING | ✓ | VARCHAR | | -| CIDR | ✓ | VARCHAR(2000000) | | -| CIRCLE | ✓ | VARCHAR(2000000) | | -| DATE | ✓ | DATE | | -| DOUBLE PRECISION | ✓ | DOUBLE | | -| INET | ✓ | VARCHAR(2000000) | | -| INTEGER | ✓ | DECIMAL(10,0) | | -| INTERVAL | ✓ | VARCHAR(2000000) | | -| JSON | ✓ | VARCHAR(2000000) | | -| JSONB | ✓ | VARCHAR(2000000) | | -| LINE | ✓ | VARCHAR(2000000) | | -| LSEG | ✓ | VARCHAR(2000000) | | -| MACADDR | ✓ | VARCHAR(2000000) | | -| MONEY | ✓ | DOUBLE | | -| NUMERIC | ✓ | DECIMAL/VARCHAR(2000000) | Stored in Exasol as DECIMAL or VARCHAR, because Snowflake NUMERIC values can exceed Exasol NUMERIC PRECISION limit. | -| PATH | ✓ | VARCHAR(2000000) | | -| POINT | ✓ | VARCHAR(2000000) | | -| POLYGON | ✓ | VARCHAR(2000000) | | -| REAL | ✓ | DOUBLE | | -| SMALLINT | ✓ | VARCHAR(2000000) | Alias for NUMBER(38,0) | -| SMALLSERIAL | (unsupported) | | | -| SERIAL | (unsupported) | | | -| TEXT | ✓ | VARCHAR(2000000) | | -| TIME | ✓ | TIME | | -| TIME WITH TIME ZONE | ✓ | VARCHAR(2000000) | | -| TIMESTAMP | ✓ | TIMESTAMP | | -| TIMESTAMP WITH TIME ZONE | ✓ | TIMESTAMP (UTC) | | -| TSQUERY | ✓ | VARCHAR(2000000) | | -| TSVECTOR | ✓ | VARCHAR(2000000) | | -| UUID | ✓ | VARCHAR(2000000) | | -| XML | ✓ | VARCHAR(2000000) | | +| Snowflake Data Type | Supported | Converted Exasol Data Type | Known limitations | +|------------------------------------------------------------------------------------------------|-----------|----------------------------|-------------------------------------| +| NUMBER,DECIMAL , DEC , NUMERIC | ✓ | DECIMAL(36,0) | Precision > 36 is not supported. | +| INT , INTEGER , BIGINT , SMALLINT , TINYINT , BYTEINT | ✓ | VARCHAR(2000000) | Alias for NUMBER(38,0) in Snowflake | +| BOOLEAN | ✓ | BOOLEAN | | +| VARCHAR,CHAR, CHARACTER, NCHAR, STRING, TEXT, NVARCHAR, NVARCHAR2, CHAR VARYING, NCHAR VARYING | ✓ | VARCHAR | | +| DATE | ✓ | DATE | | +| FLOAT,DOUBLE PRECISION,DOUBLE , REAL | ✓ | DOUBLE | | +| TIME | ✓ | TIME | | +| TIMESTAMP | ✓ | TIMESTAMP | | +| TIMESTAMP WITH TIME ZONE | ✓ | TIMESTAMP (UTC) | | \ No newline at end of file From fe23e7b963c163702942298b94b7cef434095ca0 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Mon, 30 Sep 2024 09:22:24 -0400 Subject: [PATCH 47/57] design and dev guide --- doc/design.md | 10 +++++++++- doc/developer_guide/developer_guide.md | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 doc/developer_guide/developer_guide.md diff --git a/doc/design.md b/doc/design.md index 49a8da2..c61c306 100644 --- a/doc/design.md +++ b/doc/design.md @@ -1 +1,9 @@ -# Design for the Snowflake Virtual Schema adapter \ No newline at end of file +# Design for the Snowflake Virtual Schema adapter + +## General design notes +The snowflake virtual schema's capabilities, mapping and query pushdown are mainly based on the existing PostgreSql virtual schema. +This is because the PostgreSql database approaches Snowflake the closest, functionality wise. + +## Notes on NUMERIC +The numeric datatype has a higher supported precision in Snowflake (38 vs 36 in Snowflake): +If the precision is higher than 36 the column gets mapped to varchar and will display 'Precision not supported' as value. \ No newline at end of file diff --git a/doc/developer_guide/developer_guide.md b/doc/developer_guide/developer_guide.md new file mode 100644 index 0000000..3333707 --- /dev/null +++ b/doc/developer_guide/developer_guide.md @@ -0,0 +1,24 @@ +# Developers Guide + +## Running the integration tests + +Located in `SnowflakeSqlDialectIT.java` + +### Locally + +You need to add a `test.properties` file to the project folder that has the following structure: +` +snowflake.username = +snowflake.accountname = +snowflake.password = +` + +### In the GitHub CI + +The credentials are stored in the following GitHub repository secrets: +- `USERNAME` +- `ACCOUNTNAME` +- `PASSWORD` +and get read out by the relevant CI workflows. + + From 3a2122a6a5ea3ee884e8c20d17941157e2a211aa Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Mon, 30 Sep 2024 09:24:18 -0400 Subject: [PATCH 48/57] Changes to readme.md --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d79772..161bb1a 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ # Overview +Snowflake Virtual Schema (short "VSSF") is an implementation of a [Virtual Schema](https://docs.exasol.com/db/latest/database_concepts/virtual_schemas.htm). + The **Snowflake Virtual Schema** provides an abstraction layer that makes an external [Snowflake](https://www.Snowflake.org/) database accessible from an Exasol database through regular SQL commands. The contents of the external Snowflake database are mapped to virtual tables which look like and can be queried as any regular Exasol table. If you want to set up a Virtual Schema for a different database system, please head over to the [Virtual Schemas Repository][virtual-schemas]. @@ -33,10 +35,12 @@ If you want to set up a Virtual Schema for a different database system, please h * [Changelog](doc/changes/changelog.md) * [Dependencies](dependencies.md) -Find all the documentation in the [Virtual Schemas project][vs-doc]. +Find all the documentation in the [Virtual Schemas project](https://github.com/exasol/virtual-schemas). ## Information for Developers +* [Design](doc/design.md) +* [Developer guide](doc/developer_guide/developer_guide.md) * [Virtual Schema API Documentation](https://github.com/exasol/virtual-schema-common-java/blob/main/doc/development/api/virtual_schema_api.md) * [Remote logging](https://docs.exasol.com/db/latest/database_concepts/virtual_schema/logging.htm) From 62c062cbf77782bce054382bd5e764e9b7a76498 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Mon, 30 Sep 2024 09:26:36 -0400 Subject: [PATCH 49/57] Note on deviations --- doc/design.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/design.md b/doc/design.md index c61c306..0a5aeee 100644 --- a/doc/design.md +++ b/doc/design.md @@ -2,7 +2,7 @@ ## General design notes The snowflake virtual schema's capabilities, mapping and query pushdown are mainly based on the existing PostgreSql virtual schema. -This is because the PostgreSql database approaches Snowflake the closest, functionality wise. +This is because the PostgreSql database approaches Snowflake the closest, functionality wise. Currently there are few deviations but this is expected to change. ## Notes on NUMERIC The numeric datatype has a higher supported precision in Snowflake (38 vs 36 in Snowflake): From 2ef8b179e7d7d53ca7f0f1328017ac331cce4bac Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Mon, 30 Sep 2024 09:27:49 -0400 Subject: [PATCH 50/57] Update settings.json to remove debug status and use latest docker image --- .vscode/settings.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index a7ae59b..7fc4fe8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,12 +12,12 @@ "java.test.config": { "vmArgs": [ "-Djava.util.logging.config.file=src/test/resources/logging.properties", - "-Dtest.debug='true'", - "-Dcom.exasol.dockerdb.image=8.24.0" + "-Dcom.exasol.dockerdb.image=8.31.0" ] }, "sonarlint.connectedMode.project": { "connectionId": "exasol", "projectKey": "com.exasol:snowflake-virtual-schema" - } + }, + "java.configuration.updateBuildConfiguration": "automatic" } \ No newline at end of file From ea4af97c3eda095bccc1e98629c8fe591a51b564 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Mon, 30 Sep 2024 09:28:23 -0400 Subject: [PATCH 51/57] Removed note on scalar functions --- .../exasol/adapter/dialects/snowflake/SnowflakeSqlDialect.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialect.java b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialect.java index a428b85..4170887 100644 --- a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialect.java +++ b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialect.java @@ -31,7 +31,6 @@ public class SnowflakeSqlDialect extends AbstractSqlDialect { private static final Set DISABLED_SCALAR_FUNCTION = Set.of( /* - * Implementation for `BETWEEN` time functions is not supported. For more information see `design.md` file, * `Scalar Functions` section */ SECONDS_BETWEEN, MINUTES_BETWEEN, HOURS_BETWEEN, DAYS_BETWEEN, MONTHS_BETWEEN, YEARS_BETWEEN, // @@ -62,7 +61,7 @@ public class SnowflakeSqlDialect extends AbstractSqlDialect { /* * IMPORTANT! Before adding new capabilities, check the `doc/design.md` file if there is a note on why the - * capability is not supported. it. + * capability is not supported. */ private static Capabilities createCapabilityList() { return Capabilities.builder() From b84a62f119f45c715786878960774d5898f0a213 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Mon, 30 Sep 2024 09:28:57 -0400 Subject: [PATCH 52/57] Removed unused localstack dependency, PK update to changes file --- doc/changes/changes_0.1.0.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/changes/changes_0.1.0.md b/doc/changes/changes_0.1.0.md index 84197c5..5080b42 100644 --- a/doc/changes/changes_0.1.0.md +++ b/doc/changes/changes_0.1.0.md @@ -35,7 +35,6 @@ Consider this a first and early-access release. * Added `org.junit.jupiter:junit-jupiter:5.10.1` * Added `org.mockito:mockito-junit-jupiter:5.10.0` * Added `org.testcontainers:junit-jupiter:1.19.4` -* Added `org.testcontainers:localstack:1.19.8` ### Plugin Dependency Updates From eb4ef8be2549b476055f60bcd8cda67b2ff127fc Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Mon, 30 Sep 2024 09:29:22 -0400 Subject: [PATCH 53/57] Removed newline --- .../adapter/dialects/snowflake/SnowflakeSqlDialectTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectTest.java b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectTest.java index 4e55d9d..522f0f1 100644 --- a/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectTest.java +++ b/src/test/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlDialectTest.java @@ -100,7 +100,6 @@ void testGetLiteralStringNull() { assertThat(this.dialect.getStringLiteral(null), CoreMatchers.equalTo("NULL")); } - @Test void testValidateDatabaseProperty() throws PropertyValidationException { final SqlDialect sqlDialect = new SnowflakeSqlDialect(null, new AdapterProperties(Map.of( // From 54914b8684919548132d78ea64110f8c43b84afc Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Tue, 1 Oct 2024 05:07:55 -0400 Subject: [PATCH 54/57] PK/dependencies/doc fix --- dependencies.md | 3 +-- doc/changes/changes_0.1.0.md | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dependencies.md b/dependencies.md index 0ad946f..a51a6b7 100644 --- a/dependencies.md +++ b/dependencies.md @@ -13,13 +13,12 @@ | Dependency | License | | ----------------------------------------------- | --------------------------------------------- | -| [Virtual Schema Common JDBC][0] | [MIT License][1] | | [Hamcrest][6] | [BSD License 3][7] | | [JUnit Jupiter (Aggregator)][8] | [Eclipse Public License v2.0][9] | | [mockito-junit-jupiter][10] | [MIT][11] | +| [Virtual Schema Common JDBC][0] | [MIT License][1] | | [Test containers for Exasol on Docker][12] | [MIT License][13] | | [Testcontainers :: JUnit Jupiter Extension][14] | [MIT][15] | -| [Testcontainers :: Localstack][14] | [MIT][15] | | [Test Database Builder for Java][16] | [MIT License][17] | | [Matcher for SQL Result Sets][18] | [MIT License][19] | | [udf-debugging-java][20] | [MIT License][21] | diff --git a/doc/changes/changes_0.1.0.md b/doc/changes/changes_0.1.0.md index 5080b42..c156458 100644 --- a/doc/changes/changes_0.1.0.md +++ b/doc/changes/changes_0.1.0.md @@ -61,4 +61,4 @@ Consider this a first and early-access release. * Added `org.codehaus.mojo:versions-maven-plugin:2.16.2` * Added `org.jacoco:jacoco-maven-plugin:0.8.12` * Added `org.sonarsource.scanner.maven:sonar-maven-plugin:4.0.0.4121` -* Added `org.sonatype.ossindex.maven:ossindex-maven-plugin:3.2.0` \ No newline at end of file +* Added `org.sonatype.ossindex.maven:ossindex-maven-plugin:3.2.0` From 2c6864b49c15d372e215b972cce8be5e4b85b02d Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Tue, 1 Oct 2024 05:08:22 -0400 Subject: [PATCH 55/57] removed unused code --- .../snowflake/SnowflakeSqlGenerationVisitor.java | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitor.java b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitor.java index 397a4f7..73e06cc 100644 --- a/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitor.java +++ b/src/main/java/com/exasol/adapter/dialects/snowflake/SnowflakeSqlGenerationVisitor.java @@ -16,9 +16,6 @@ * This class generates SQL queries for the {@link SnowflakeSqlDialect}. */ public class SnowflakeSqlGenerationVisitor extends SqlGenerationVisitor { - private static final List TYPE_NAMES_REQUIRING_CAST = List.of("varbit", "point", "line", "lseg", "box", - "path", "polygon", "circle", "cidr", "citext", "inet", "macaddr", "interval", "json", "jsonb", "uuid", - "tsquery", "tsvector", "xml", "smallserial", "serial", "bigserial"); private static final List TYPE_NAMES_NOT_SUPPORTED = List.of("bytea"); /** @@ -31,14 +28,6 @@ public SnowflakeSqlGenerationVisitor(final SqlDialect dialect, final SqlGenerati super(dialect, context); } - protected List getListOfTypeNamesRequiringCast() { - return TYPE_NAMES_REQUIRING_CAST; - } - - protected List getListOfTypeNamesNotSupported() { - return TYPE_NAMES_NOT_SUPPORTED; - } - @Override protected String representAnyColumnInSelectList() { return SqlConstants.ONE; From 04f7a68d6c181830f5115e7f4d6abbd81fca01d0 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Tue, 1 Oct 2024 05:22:16 -0400 Subject: [PATCH 56/57] release date --- doc/changes/changes_0.1.0.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/changes/changes_0.1.0.md b/doc/changes/changes_0.1.0.md index c156458..3aa7429 100644 --- a/doc/changes/changes_0.1.0.md +++ b/doc/changes/changes_0.1.0.md @@ -1,4 +1,4 @@ -# Virtual Schema for Snowflake 0.1.0, released 2024-09-27 +# Virtual Schema for Snowflake 0.1.0, released 2024-10-01 Code name: First version of the Snowflake virtual schema @@ -43,16 +43,16 @@ Consider this a first and early-access release. * Added `com.exasol:project-keeper-maven-plugin:4.3.3` * Added `io.github.zlika:reproducible-build-maven-plugin:0.16` * Added `org.apache.maven.plugins:maven-assembly-plugin:3.7.1` -* Added `org.apache.maven.plugins:maven-clean-plugin:2.5` +* Added `org.apache.maven.plugins:maven-clean-plugin:3.2.0` * Added `org.apache.maven.plugins:maven-compiler-plugin:3.13.0` * Added `org.apache.maven.plugins:maven-dependency-plugin:3.6.1` -* Added `org.apache.maven.plugins:maven-deploy-plugin:2.7` +* Added `org.apache.maven.plugins:maven-deploy-plugin:3.1.1` * Added `org.apache.maven.plugins:maven-enforcer-plugin:3.5.0` * Added `org.apache.maven.plugins:maven-failsafe-plugin:3.2.5` -* Added `org.apache.maven.plugins:maven-install-plugin:2.4` +* Added `org.apache.maven.plugins:maven-install-plugin:3.1.1` * Added `org.apache.maven.plugins:maven-jar-plugin:3.4.1` -* Added `org.apache.maven.plugins:maven-resources-plugin:2.6` -* Added `org.apache.maven.plugins:maven-site-plugin:3.3` +* Added `org.apache.maven.plugins:maven-resources-plugin:3.3.1` +* Added `org.apache.maven.plugins:maven-site-plugin:3.12.1` * Added `org.apache.maven.plugins:maven-surefire-plugin:3.2.5` * Added `org.apache.maven.plugins:maven-toolchains-plugin:3.2.0` * Added `org.basepom.maven:duplicate-finder-maven-plugin:2.0.1` From 719866498e5c034c6aeec22d1bf0c234cd0bbf15 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Tue, 1 Oct 2024 10:45:38 -0400 Subject: [PATCH 57/57] fix dependencies in changes doc --- doc/changes/changes_0.1.0.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/changes/changes_0.1.0.md b/doc/changes/changes_0.1.0.md index 3aa7429..05e133a 100644 --- a/doc/changes/changes_0.1.0.md +++ b/doc/changes/changes_0.1.0.md @@ -43,16 +43,16 @@ Consider this a first and early-access release. * Added `com.exasol:project-keeper-maven-plugin:4.3.3` * Added `io.github.zlika:reproducible-build-maven-plugin:0.16` * Added `org.apache.maven.plugins:maven-assembly-plugin:3.7.1` -* Added `org.apache.maven.plugins:maven-clean-plugin:3.2.0` +* Added `org.apache.maven.plugins:maven-clean-plugin:2.5` * Added `org.apache.maven.plugins:maven-compiler-plugin:3.13.0` * Added `org.apache.maven.plugins:maven-dependency-plugin:3.6.1` -* Added `org.apache.maven.plugins:maven-deploy-plugin:3.1.1` +* Added `org.apache.maven.plugins:maven-deploy-plugin:2.7` * Added `org.apache.maven.plugins:maven-enforcer-plugin:3.5.0` * Added `org.apache.maven.plugins:maven-failsafe-plugin:3.2.5` -* Added `org.apache.maven.plugins:maven-install-plugin:3.1.1` +* Added `org.apache.maven.plugins:maven-install-plugin:2.4` * Added `org.apache.maven.plugins:maven-jar-plugin:3.4.1` -* Added `org.apache.maven.plugins:maven-resources-plugin:3.3.1` -* Added `org.apache.maven.plugins:maven-site-plugin:3.12.1` +* Added `org.apache.maven.plugins:maven-resources-plugin:2.6` +* Added `org.apache.maven.plugins:maven-site-plugin:3.3` * Added `org.apache.maven.plugins:maven-surefire-plugin:3.2.5` * Added `org.apache.maven.plugins:maven-toolchains-plugin:3.2.0` * Added `org.basepom.maven:duplicate-finder-maven-plugin:2.0.1`