adding new property TableName in the ui and its functionality#5
Open
AbhishekKumar9984 wants to merge 3 commits intocloudsufi:developfrom
Open
adding new property TableName in the ui and its functionality#5AbhishekKumar9984 wants to merge 3 commits intocloudsufi:developfrom
AbhishekKumar9984 wants to merge 3 commits intocloudsufi:developfrom
Conversation
| return fieldDescriptors; | ||
| } | ||
|
|
||
| public List<SnowflakeFieldDescriptor> describeTable(String schemaName, String tableName) throws SQLException { |
There was a problem hiding this comment.
Add Javadoc for public methods
| } | ||
| } | ||
|
|
||
| public String getSchema() { |
| String copy = String.format(COMAND_COPY_INTO, QueryUtil.removeSemicolon(config.getImportQuery())); | ||
| String importQuery = config.getImportQuery(); | ||
| if (Strings.isNullOrEmpty(importQuery)) { | ||
| importQuery = "SELECT * FROM " + config.getTableName(); |
There was a problem hiding this comment.
It's better to use String.format method
|
|
||
| SnowflakeBatchSourceConfig mockConfig = Mockito.mock(SnowflakeBatchSourceConfig.class); | ||
| Mockito.when(mockConfig.getSchema()).thenReturn("{}"); | ||
| // SchemaHelper.getSchema(null, "{}", collector, null); |
Author
There was a problem hiding this comment.
i think its better to not remove the comments it will help other developer to easily see what changes i had made to the particular line of code.
| import java.io.FileWriter; | ||
| import java.io.IOException; | ||
| import java.lang.reflect.Field; | ||
| //import java.sql.*; |
| * A class which will help in connection | ||
| */ | ||
|
|
||
| public void runSQL(String query) { |
|
|
||
| public LoadUnloadConfig(String accountName, String database, | ||
| String schemaName, String username, String password, | ||
| String schemaName, String tableName, String username, String password, |
There was a problem hiding this comment.
tableName is not required here!
| @Macro | ||
| private String schemaName; | ||
|
|
||
| @Name(PROPERTY_TABLE_NAME) |
There was a problem hiding this comment.
Table Name should be moved under Basic section using widgets.json
| private String pattern; | ||
|
|
||
| public LoadActionConfig(String accountName, String database, String schemaName, String username, String password, | ||
| public LoadActionConfig(String accountName, String database, String schemaName, String tableName, |
There was a problem hiding this comment.
tableName not required here as well
| } | ||
|
|
||
| public static Schema getSchema(SnowflakeAccessor snowflakeAccessor, String schemaName, | ||
| public static Schema getSchema(SnowflakeAccessor snowflakeAccessor, |
There was a problem hiding this comment.
The getSchema method used within the SchemaHelper class only should be made private
| @@ -105,7 +105,7 @@ private void validateInputSchema(Schema schema, FailureCollector failureCollecto | |||
|
|
|||
| SnowflakeAccessor snowflakeAccessor = new SnowflakeAccessor(this); | |||
| // Schema expectedSchema = SchemaHelper.getSchema(snowflakeAccessor, String.format(GET_FIELDS_QUERY, tableName)); | |||
| Schema actual = SchemaHelper.getSchema(mockConfig, collector); | ||
| // SnowflakeBatchSourceConfig mockConfig = Mockito.mock(SnowflakeBatchSourceConfig.class); | ||
| // Mockito.when(mockConfig.canConnect()).thenReturn(false); | ||
| // Mockito.when(mockConfig.getSchema()).thenReturn(expected.toString()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
adding new property TableName in the ui and its functionality i.e now user can get reterive the data from giving tablename without providing the import query.