<commit_before>// de.ifsr.adam

import org.json.*;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Scanner;
import java.sql.Statement;

public class Report{

	JSONArray report = null;

	private final static Charset ENCODING = StandardCharsets.UTF_8; 
	private final String tableName = null;

	public Report(String reportPath,String tableName){
		Path path = Paths.get(reportPath);
		String jsonStr = new String();
		String this.tableName = tableName;
		
		try (Scanner scanner = new Scanner(path,ENCODING.name())){

			while(scanner.hasNext()){
				jsonStr += scanner.nextLine();
			}
			report = new JSONArray(jsonStr);

		}
		catch(Exception e){
			System.out.println(e);
		}
	}


	public JSONArray getResult(){
		for(int i = 0; i < report.length(); i++){
			try {
				System.out.println(report.getJSONObject(i));
			}
			catch(Exception e){
				System.out.println(e);
			}
		}
		return null;
	}

	private JSONObject getQuestionResult(JSONObject question) throws JSONException{
		DBController ct = DBController.getInstance();
		ct.initDBConnection();

		String sqlQuery = "SELECT " + question.getString("question") + " FROM " + tableName;

		try {
			Statement stmt = ct.getStatement(sqlQuery);
			stmt.executeUpdate();

			/*SELECT b1.F1,COUNT(b2.F1) FROM b3CSV b1
			  INNER JOIN b3CSV b2 ON b1.rowid = b2.rowid
			  GROUP BY b1.F1
			  ORDER BY b1.F1 ASC
			*/
		}


	}


	public static void main(String[] args){
		Report report = new Report("C:/Users/Simon/Desktop/JAdam/report.json","b3CSV"); 
		report.getResult();
	}
}<commit_msg>Worked on the sql query.<commit_after>// de.ifsr.adam

import org.json.*;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Scanner;
import java.sql.Statement;
import java.sql.SQLException;
import java.sql.ResultSet;

public class Report{

	JSONArray report = null;

	private final static Charset ENCODING = StandardCharsets.UTF_8; 
	private final String tableName;

	public Report(String reportPath,String tableName){
		Path path = Paths.get(reportPath);
		String jsonStr = new String();
		this.tableName = tableName;
		
		try (Scanner scanner = new Scanner(path,ENCODING.name())){

			while(scanner.hasNext()){
				jsonStr += scanner.nextLine();
			}
			report = new JSONArray(jsonStr);

		}
		catch(Exception e){
			System.out.println(e);
		}
	}


	public JSONArray getResult(){
		for(int i = 0; i < report.length(); i++){
			try {
				this.getQuestionResult(report.getJSONObject(i));
			}
			catch(Exception e){
				System.out.println(e);
			}
		}
		return null;
	}

	private JSONObject getQuestionResult(JSONObject question) throws JSONException{
		DBController ct = DBController.getInstance();
		ct.initDBConnection();

		String sqlQuery = "SELECT t1." + question.getString("question") + ",COUNT(t2." + question.getString("question") +") ";
		sqlQuery += "FROM " + tableName + " t1 ";
		sqlQuery += "INNER JOIN " + tableName + " t2 ON t1.rowid=t2.rowid ";
		sqlQuery += "GROUP BY t1." + question.getString("question") + " ";
		sqlQuery += "ORDER BY t1." + question.getString("question") + " ASC;";

		System.out.println(sqlQuery);

		/*SELECT b1.F1,COUNT(b2.F1) FROM b3CSV b1
		 INNER JOIN b3CSV b2 ON b1.rowid = b2.rowid
		 GROUP BY b1.F1
		 ORDER BY b1.F1 ASC
		*/

		 try {
		 	Statement stmt = ct.getStatement();
		 	ResultSet resultSet = stmt.executeQuery(sqlQuery);
		 	JSONArray resultObject = new JSONObject();
		 	
		 	while(resultSet.next()){
		 		resultSet.getInt(1);
		 		resultSet.getInt(2);	
		 	}

		 }
		 catch (SQLException e) {
		 	System.out.println(e);
		 }

		return null;


	}


	public static void main(String[] args){
		Report report = new Report("C:/Users/Simon/Desktop/JAdam/report.json","b3CSV"); 
		report.getResult();
	}
}
{'fraction_non_alphanumeric': 0.13540596094552929, 'fraction_numerical': 0.011305241521068859, 'mean_word_length': 3.6511350059737158, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1394968', 'n_tokens_mistral': 1525, 'n_tokens_neox': 1294, 'n_words': 299}