Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP-5460 Several enhancements #1976

Merged
merged 4 commits into from
Apr 27, 2022
Merged

AP-5460 Several enhancements #1976

merged 4 commits into from
Apr 27, 2022

Conversation

franklma
Copy link
Contributor

@franklma franklma commented Apr 26, 2022

  1. Only consider non-empty values when guessing the type by reading the 100 rows sample used in Log Importer
  2. The “types” could be made optional and by default, when they are not given, all fields will be treated as “String”. With this “default” convention, maybe we would provide more flexibility to the API.
  3. Corner cases when detecting the data type
  4. Handle "other timestamps" in existing schema mapping
  5. Handle Boolean data type
  6. Add unit tests



@Data
@NoArgsConstructor
public class LogMetaData {

private static final Logger LOGGER = LoggerFactory.getLogger(LogMetaData.class);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could use Lombok notation @Sl4j for logging instead of defining LOGGER.

@@ -94,7 +97,12 @@ public static ColumnType getColumnType(final List<String> stringList) {
temp.put(ColumnType.DOUBLE, 0);
temp.put(ColumnType.TIMESTAMP, 0);

stringList.forEach(st -> {
List<String> filteredList = stringList.stream()
.filter(Objects::nonNull)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could combine both using StringUtils.isEmpty(). This will test for both the null and empty strings

Copy link
Contributor

@mayankgituni mayankgituni left a comment

Choose a reason for hiding this comment

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

looks good to me!

@sonarcloud
Copy link

sonarcloud bot commented Apr 27, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

53.8% 53.8% Coverage
0.0% 0.0% Duplication

@franklma franklma merged commit a61c966 into development Apr 27, 2022
@franklma franklma deleted the AP-5460-enhancements branch April 27, 2022 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants